[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: try:
import cython import cython
COMPILED = cython.compiled
except (AttributeError, ImportError): except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types # if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython from fontTools.misc import cython
COMPILED = cython.compiled
COMPILED = False
import math import math

View File

@ -9,13 +9,10 @@ from collections import namedtuple
try: try:
import cython import cython
COMPILED = cython.compiled
except (AttributeError, ImportError): except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types # if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython from fontTools.misc import cython
COMPILED = cython.compiled
COMPILED = False
EPSILON = 1e-9 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 """from fontTools.pens.basePen import BasePen, OpenContourError
try: try:
import cython import cython
COMPILED = cython.compiled
except (AttributeError, ImportError): except (AttributeError, ImportError):
# if cython not installed, use mock module with no-op decorators and types # if cython not installed, use mock module with no-op decorators and types
from fontTools.misc import cython from fontTools.misc import cython
COMPILED = cython.compiled
COMPILED = False
__all__ = ["%s"] __all__ = ["%s"]

View File

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

View File

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

View File

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