summaryrefslogtreecommitdiff
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 1301bd84..19849e66 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -14,7 +14,7 @@ import io
import warnings
import time
-from setuptools.compat import basestring, PY3, StringIO
+import six
from setuptools import Command
from setuptools.command.sdist import sdist
@@ -148,7 +148,7 @@ class egg_info(Command):
to the file.
"""
log.info("writing %s to %s", what, filename)
- if PY3:
+ if six.PY3:
data = data.encode("utf-8")
if not self.dry_run:
f = open(filename, 'wb')
@@ -412,7 +412,7 @@ def _write_requirements(stream, reqs):
def write_requirements(cmd, basename, filename):
dist = cmd.distribution
- data = StringIO()
+ data = six.StringIO()
_write_requirements(data, dist.install_requires)
extras_require = dist.extras_require or {}
for extra in sorted(extras_require):
@@ -452,12 +452,12 @@ def write_arg(cmd, basename, filename, force=False):
def write_entries(cmd, basename, filename):
ep = cmd.distribution.entry_points
- if isinstance(ep, basestring) or ep is None:
+ if isinstance(ep, six.string_types) or ep is None:
data = ep
elif ep is not None:
data = []
for section, contents in sorted(ep.items()):
- if not isinstance(contents, basestring):
+ if not isinstance(contents, six.string_types):
contents = EntryPoint.parse_group(section, contents)
contents = '\n'.join(sorted(map(str, contents.values())))
data.append('[%s]\n%s\n\n' % (section, contents))