Commits

Anonymous committed aff44fc

easy_install always chose 32bit cli.exe, even on windows64bit

fixed

  • Participants
  • Parent commits 8e3cea8

Comments (0)

Files changed (1)

File setuptools/command/easy_install.py

             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]
+            null_byte = bytes([0]) if sys.version_info >= (2,6) else chr(0)
+            config, = part.split(null_byte, 1)[0]
             # Now the config is in bytes, but on Python 3, it must be
             #  unicode for the RawConfigParser, so decode it. Is this the
             #  right encoding?
             if sys.platform=='win32' or wininst:
                 # On Windows/wininst, add a .py extension and an .exe launcher
                 if group=='gui_scripts':
-                    ext, launcher = '-script.pyw', 'gui.exe'
+                    ext, launcher = '-script.pyw', 'gui-64.exe' if sys.maxsize > 2**32 else 'gui-32.exe'
                     old = ['.pyw']
                     new_header = re.sub('(?i)python.exe','pythonw.exe',header)
                 else:
-                    ext, launcher = '-script.py', 'cli.exe'
+                    ext, launcher = '-script.py', 'cli-64.exe' if sys.maxsize > 2**32 else 'cli-32.exe'
                     old = ['.py','.pyc','.pyo']
                     new_header = re.sub('(?i)pythonw.exe','python.exe',header)