diff options
| author | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-08-16 12:34:46 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-16 12:34:46 +0000 |
| commit | f991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2 (patch) | |
| tree | a044b31a3276cc4a51b7fc23776a32b380562bad /setuptools/command/bdist_egg.py | |
| parent | 4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff) | |
| parent | 45e0ea0ff10a64f315a5c65b6805327222e5b565 (diff) | |
| download | python-setuptools-git-f991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2.tar.gz | |
Merge pull request #2332 from pypa/debt/cleanup-py2
Remove legacy Python 2 code
Diffstat (limited to 'setuptools/command/bdist_egg.py')
| -rw-r--r-- | setuptools/command/bdist_egg.py | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 4be15457..a88efb45 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -13,24 +13,16 @@ import textwrap import marshal import warnings -from setuptools.extern import six - from pkg_resources import get_build_platform, Distribution, ensure_directory from pkg_resources import EntryPoint from setuptools.extension import Library from setuptools import Command, SetuptoolsDeprecationWarning -try: - # Python 2.7 or >=3.2 - from sysconfig import get_path, get_python_version +from sysconfig import get_path, get_python_version - def _get_purelib(): - return get_path("purelib") -except ImportError: - from distutils.sysconfig import get_python_lib, get_python_version - def _get_purelib(): - return get_python_lib(False) +def _get_purelib(): + return get_path("purelib") def strip_module(filename): @@ -420,9 +412,7 @@ def scan_module(egg_dir, base, name, stubs): return True # Extension module pkg = base[len(egg_dir) + 1:].replace(os.sep, '.') module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0] - if six.PY2: - skip = 8 # skip magic & date - elif sys.version_info < (3, 7): + if sys.version_info < (3, 7): skip = 12 # skip magic & date & file size else: skip = 16 # skip magic & reserved? & date & file size @@ -453,7 +443,7 @@ def iter_symbols(code): for name in code.co_names: yield name for const in code.co_consts: - if isinstance(const, six.string_types): + if isinstance(const, str): yield const elif isinstance(const, CodeType): for name in iter_symbols(const): |
