Remove some Python 2 era import gaming
This commit is contained in:
parent
cea5abd676
commit
969df8303b
@ -7,16 +7,9 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
import timeit
|
import timeit
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
try:
|
from collections.abc import Mapping, Callable
|
||||||
from collections.abc import Mapping, Callable
|
|
||||||
except ImportError: # python < 3.3
|
|
||||||
from collections import Mapping, Callable
|
|
||||||
import warnings
|
import warnings
|
||||||
|
from logging import PercentStyle
|
||||||
try:
|
|
||||||
from logging import PercentStyle
|
|
||||||
except ImportError:
|
|
||||||
PercentStyle = None
|
|
||||||
|
|
||||||
|
|
||||||
# default logging level used by Timer class
|
# default logging level used by Timer class
|
||||||
|
@ -3,10 +3,7 @@ from fontTools.misc.py23 import *
|
|||||||
import struct
|
import struct
|
||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
try:
|
from collections.abc import MutableMapping
|
||||||
from collections.abc import MutableMapping
|
|
||||||
except ImportError:
|
|
||||||
from UserDict import DictMixin as MutableMapping
|
|
||||||
|
|
||||||
|
|
||||||
class ResourceError(Exception):
|
class ResourceError(Exception):
|
||||||
|
@ -5,18 +5,8 @@ from datetime import datetime
|
|||||||
from base64 import b64encode, b64decode
|
from base64 import b64encode, b64decode
|
||||||
from numbers import Integral
|
from numbers import Integral
|
||||||
|
|
||||||
try:
|
from collections.abc import Mapping
|
||||||
from collections.abc import Mapping # python >= 3.3
|
from functools import singledispatch
|
||||||
except ImportError:
|
|
||||||
from collections import Mapping
|
|
||||||
|
|
||||||
try:
|
|
||||||
from functools import singledispatch
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
from singledispatch import singledispatch
|
|
||||||
except ImportError:
|
|
||||||
singledispatch = None
|
|
||||||
|
|
||||||
from fontTools.misc import etree
|
from fontTools.misc import etree
|
||||||
|
|
||||||
|
@ -2,10 +2,7 @@ from fontTools.misc.py23 import *
|
|||||||
from fontTools.misc import eexec
|
from fontTools.misc import eexec
|
||||||
from .psOperators import *
|
from .psOperators import *
|
||||||
import re
|
import re
|
||||||
try:
|
from collections.abc import Callable
|
||||||
from collections.abc import Callable
|
|
||||||
except ImportError: # python < 3.3
|
|
||||||
from collections import Callable
|
|
||||||
from string import whitespace
|
from string import whitespace
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
"""Helpers for writing unit tests."""
|
"""Helpers for writing unit tests."""
|
||||||
|
|
||||||
try:
|
from collections.abc import Iterable
|
||||||
from collections.abc import Iterable
|
|
||||||
except ImportError: # python < 3.3
|
|
||||||
from collections import Iterable
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
@ -2,6 +2,7 @@ from fontTools.misc.py23 import *
|
|||||||
from fontTools.misc import sstruct
|
from fontTools.misc import sstruct
|
||||||
from . import DefaultTable
|
from . import DefaultTable
|
||||||
import array
|
import array
|
||||||
|
from collections.abc import Mapping
|
||||||
|
|
||||||
hdmxHeaderFormat = """
|
hdmxHeaderFormat = """
|
||||||
> # big endian!
|
> # big endian!
|
||||||
@ -10,11 +11,6 @@ hdmxHeaderFormat = """
|
|||||||
recordSize: l
|
recordSize: l
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
|
||||||
from collections.abc import Mapping
|
|
||||||
except:
|
|
||||||
from UserDict import DictMixin as Mapping
|
|
||||||
|
|
||||||
class _GlyphnamedList(Mapping):
|
class _GlyphnamedList(Mapping):
|
||||||
|
|
||||||
def __init__(self, reverseGlyphOrder, data):
|
def __init__(self, reverseGlyphOrder, data):
|
||||||
|
@ -10,10 +10,7 @@ from fontTools.misc.textTools import safeEval
|
|||||||
from fontTools.ttLib import TTLibError
|
from fontTools.ttLib import TTLibError
|
||||||
from . import DefaultTable
|
from . import DefaultTable
|
||||||
import struct
|
import struct
|
||||||
try:
|
from collections.abc import MutableMapping
|
||||||
from collections.abc import MutableMapping
|
|
||||||
except ImportError:
|
|
||||||
from UserDict import DictMixin as MutableMapping
|
|
||||||
|
|
||||||
|
|
||||||
# Apple's documentation of 'trak':
|
# Apple's documentation of 'trak':
|
||||||
|
@ -12,11 +12,8 @@ from fontTools.ufoLib.plistlib import (
|
|||||||
readPlist, readPlistFromString, writePlist, writePlistToString,
|
readPlist, readPlistFromString, writePlist, writePlistToString,
|
||||||
)
|
)
|
||||||
import pytest
|
import pytest
|
||||||
|
from collections.abc import Mapping
|
||||||
|
|
||||||
try:
|
|
||||||
from collections.abc import Mapping # python >= 3.3
|
|
||||||
except ImportError:
|
|
||||||
from collections import Mapping
|
|
||||||
|
|
||||||
PY2 = sys.version_info < (3,)
|
PY2 = sys.version_info < (3,)
|
||||||
if PY2:
|
if PY2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user