summaryrefslogtreecommitdiff
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authormergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-08-16 12:34:46 +0000
committerGitHub <noreply@github.com>2020-08-16 12:34:46 +0000
commitf991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2 (patch)
treea044b31a3276cc4a51b7fc23776a32b380562bad /setuptools/command/egg_info.py
parent4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff)
parent45e0ea0ff10a64f315a5c65b6805327222e5b565 (diff)
downloadpython-setuptools-git-f991fbb3c9d0e10a0a78ae2b508b3fd99f9cdef2.tar.gz
Merge pull request #2332 from pypa/debt/cleanup-py2
Remove legacy Python 2 code
Diffstat (limited to 'setuptools/command/egg_info.py')
-rw-r--r--setuptools/command/egg_info.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 0855207c..c957154a 100644
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -16,9 +16,6 @@ import warnings
import time
import collections
-from setuptools.extern import six
-from setuptools.extern.six.moves import map
-
from setuptools import Command
from setuptools.command.sdist import sdist
from setuptools.command.sdist import walk_revctrl
@@ -267,8 +264,7 @@ class egg_info(InfoCommon, Command):
to the file.
"""
log.info("writing %s to %s", what, filename)
- if not six.PY2:
- data = data.encode("utf-8")
+ data = data.encode("utf-8")
if not self.dry_run:
f = open(filename, 'wb')
f.write(data)
@@ -647,7 +643,7 @@ def _write_requirements(stream, reqs):
def write_requirements(cmd, basename, filename):
dist = cmd.distribution
- data = six.StringIO()
+ data = io.StringIO()
_write_requirements(data, dist.install_requires)
extras_require = dist.extras_require or {}
for extra in sorted(extras_require):
@@ -687,12 +683,12 @@ def write_arg(cmd, basename, filename, force=False):
def write_entries(cmd, basename, filename):
ep = cmd.distribution.entry_points
- if isinstance(ep, six.string_types) or ep is None:
+ if isinstance(ep, str) or ep is None:
data = ep
elif ep is not None:
data = []
for section, contents in sorted(ep.items()):
- if not isinstance(contents, six.string_types):
+ if not isinstance(contents, str):
contents = EntryPoint.parse_group(section, contents)
contents = '\n'.join(sorted(map(str, contents.values())))
data.append('[%s]\n%s\n\n' % (section, contents))