summaryrefslogtreecommitdiff
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-08-16 00:29:24 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-08-16 07:15:18 -0400
commitfb7ab81a3d080422687bad71f9ae9d36eeefbee2 (patch)
treed87a9f6fdf32ab64334e1eb8a695949a88a3b043 /setuptools/command/egg_info.py
parent4eb5b32f8d8bb1e20907028a516346e2b1901391 (diff)
downloadpython-setuptools-git-fb7ab81a3d080422687bad71f9ae9d36eeefbee2.tar.gz
Remove Python 2 compatibility
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))