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