Anonymous avatar Anonymous committed aff44fc

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

fixed

Comments (0)

Files changed (1)

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)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.