diff options
| author | Johannes Reiff <mail@jreiff.de> | 2020-01-25 14:17:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-25 14:17:40 +0100 |
| commit | 6ee1a1ce60c6d039c63def3c2aeba7e0f39e7507 (patch) | |
| tree | 254243b04be614ee4ea346ccb7c25fb9deb11f5f /setuptools/command/egg_info.py | |
| parent | ec270f9e13fcc32a2a861273219ebfeba17838df (diff) | |
| parent | 73376585065bbf28395c71fe15137c19a712d4f3 (diff) | |
| download | python-setuptools-git-6ee1a1ce60c6d039c63def3c2aeba7e0f39e7507.tar.gz | |
Merge branch 'master' into pr-easyinstall
Diffstat (limited to 'setuptools/command/egg_info.py')
| -rw-r--r-- | setuptools/command/egg_info.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 5d8f451e..7fa89541 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -33,6 +33,7 @@ from setuptools.glob import glob from setuptools.extern import packaging from setuptools import SetuptoolsDeprecationWarning + def translate_pattern(glob): """ Translate a file path glob like '*.txt' in to a regular expression. @@ -113,7 +114,7 @@ def translate_pattern(glob): pat += sep pat += r'\Z' - return re.compile(pat, flags=re.MULTILINE|re.DOTALL) + return re.compile(pat, flags=re.MULTILINE | re.DOTALL) class InfoCommon: @@ -266,7 +267,7 @@ class egg_info(InfoCommon, Command): to the file. """ log.info("writing %s to %s", what, filename) - if six.PY3: + if not six.PY2: data = data.encode("utf-8") if not self.dry_run: f = open(filename, 'wb') @@ -637,7 +638,9 @@ def warn_depends_obsolete(cmd, basename, filename): def _write_requirements(stream, reqs): lines = yield_lines(reqs or ()) - append_cr = lambda line: line + '\n' + + def append_cr(line): + return line + '\n' lines = map(append_cr, lines) stream.writelines(lines) @@ -703,7 +706,8 @@ def get_pkg_info_revision(): Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. """ - warnings.warn("get_pkg_info_revision is deprecated.", EggInfoDeprecationWarning) + warnings.warn( + "get_pkg_info_revision is deprecated.", EggInfoDeprecationWarning) if os.path.exists('PKG-INFO'): with io.open('PKG-INFO') as f: for line in f: @@ -714,4 +718,4 @@ def get_pkg_info_revision(): class EggInfoDeprecationWarning(SetuptoolsDeprecationWarning): - """Class for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning.""" + """Deprecated behavior warning for EggInfo, bypassing suppression.""" |
