On 12/6/2010 11:12 AM, Isaac Wagner wrote:
Shouldn't the comparison be 2**31 instead of 3**32?
Oops, typo there. The left side should obviously be 2, not 3.
But I intentionally used 32 for the exponent, not 31. My thinking was
that on some hypothetical system, sys.maxint might be the maximum
unsigned int (not likely, but who knows?), so it was safer to use 32. We
don't need to be terribly precise since 64-bit maxint is many orders of
magnitude larger.
The fails for me on Win64 with a 64-bit Python install. For some
reason sys.maxint returns the same on my Win32 or Win64 boxes.
That's inconvenient. I guess we should stick with
platform.architecture() on non-Mac platforms.
I've attached a new patch that incorporates both these fixes.
- Nathan
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.
Index: Build.py
===================================================================
--- Build.py (revision 1282)
+++ Build.py (working copy)
@@ -155,6 +155,23 @@
new_toc.append((inm, fnm, typ))
return new_toc
+def architecture():
+ """
+ Returns the bit depth of the python interpreter's architecture as
+ a string ('32bit' or '64bit'). Similar to platform.architecture(),
+ but with fixes for universal binaries on MacOS.
+ """
+
+ if sys.platform == 'darwin':
+ # platform.architecture() is confused by universal binaries on MacOS.
+ # Look at sys.maxint instead
+ if sys.maxint > 2**32:
+ return '64bit'
+ else:
+ return '32bit'
+ else:
+ return platform.architecture()[0]
+
#--- functons for checking guts ---
def _check_guts_eq(attr, old, new, last_build):
@@ -929,7 +946,7 @@
try:
import platform
- dir = platform.system() + "-" + platform.architecture()[0]
+ dir = platform.system() + "-" + architecture()
except ImportError:
import os
n = { "nt": "Windows", "linux2": "Linux", "darwin": "Darwin" }
Index: Configure.py
===================================================================
--- Configure.py (revision 1282)
+++ Configure.py (working copy)
@@ -319,6 +319,12 @@
if __name__ == '__main__':
+ if sys.platform == 'darwin' and Build.architecture() == '64bit':
+ print "ERROR: PyInstaller does not support Python 64-bit on Mac OSX"
+ print "Try using the 32-bit version of Python, by setting"
+ print "VERSIONER_PYTHON_PREFER_32_BIT=yes in the environment"
+ sys.exit(2)
+
from pyi_optparse import OptionParser
parser = OptionParser(usage="%prog [options]")
parser.add_option('--target-platform', default=None,