diff options
author | Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com> | 2015-02-18 20:42:49 +0100 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com> | 2015-02-18 20:42:49 +0100 |
commit | 47cbdc5228ca5a730518f1cca83df283c54f7249 (patch) | |
tree | dbb9df119940f565a8e73872e2799561e57fb6ee /setuptools/command/easy_install.py | |
parent | c30d4387af485202103c76b13c2741b5bd78b410 (diff) | |
download | external_python_setuptools-47cbdc5228ca5a730518f1cca83df283c54f7249.tar.gz external_python_setuptools-47cbdc5228ca5a730518f1cca83df283c54f7249.tar.bz2 external_python_setuptools-47cbdc5228ca5a730518f1cca83df283c54f7249.zip |
Fix setuptools.command.easy_install.extract_wininst_cfg() with Python 2.6 and 2.7.
It was broken since commit 3bbd42903af8, which changed chr(0) (which is '\x00') into bytes([0]).
bytes([0]) is '[0]' in Python 2.6 and 2.7 and b'\x00' in Python 3.
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-x | setuptools/command/easy_install.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index e057b508..b039e2da 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1413,13 +1413,8 @@ def extract_wininst_cfg(dist_filename): {'version': '', 'target_version': ''}) try: part = f.read(cfglen) - # part is in bytes, but we need to read up to the first null - # byte. - if sys.version_info >= (2, 6): - null_byte = bytes([0]) - else: - null_byte = chr(0) - config = part.split(null_byte, 1)[0] + # Read up to the first null byte. + config = part.split(b'\0', 1)[0] # Now the config is in bytes, but for RawConfigParser, it should # be text, so decode it. config = config.decode(sys.getfilesystemencoding()) |