[cython] Simplify COMPILED variables

This commit is contained in:
Behdad Esfahbod 2024-11-27 18:15:19 -07:00
parent 0c26044a63
commit e037cea726
6 changed files with 6 additions and 24 deletions

View File

@ -17,13 +17,10 @@
try:
import cython
COMPILED = cython.compiled
except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython
COMPILED = False
COMPILED = cython.compiled
import math

View File

@ -9,13 +9,10 @@ from collections import namedtuple
try:
import cython
COMPILED = cython.compiled
except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython
COMPILED = False
COMPILED = cython.compiled
EPSILON = 1e-9

View File

@ -121,13 +121,10 @@ def printGreenPen(penName, funcs, file=sys.stdout, docstring=None):
"""from fontTools.pens.basePen import BasePen, OpenContourError
try:
import cython
COMPILED = cython.compiled
except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython
COMPILED = False
COMPILED = cython.compiled
__all__ = ["%s"]

View File

@ -2,13 +2,10 @@ from fontTools.pens.basePen import BasePen, OpenContourError
try:
import cython
COMPILED = cython.compiled
except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython
COMPILED = False
COMPILED = cython.compiled
__all__ = ["MomentsPen"]

View File

@ -18,13 +18,10 @@
try:
import cython
COMPILED = cython.compiled
except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython
COMPILED = False
COMPILED = cython.compiled
from fontTools.misc.bezierTools import splitCubicAtTC
from collections import namedtuple

View File

@ -1,12 +1,9 @@
try:
import cython
COMPILED = cython.compiled
except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython
COMPILED = False
COMPILED = cython.compiled
from typing import (
Sequence,