[PyObjC-svn] r2287 - trunk/pyobjc/pyobjc-core/Lib/PyObjCTools

[email protected] Tue, 22 Sep 2009 04:41:23 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Tue Sep 22 04:41:23 2009
New Revision: 2287

Log:
Add function to test if tests are run in 32-bit mode.


Modified:
   trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py

Modified: trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py	Tue Sep 22 04:41:23 2009
@@ -85,6 +85,16 @@
     v = pl['ProductVersion']
     return '.'.join(v.split('.')[:2])
 
+
+def is32Bit():
+    """
+    Return True if we're running in 32-bit mode
+    """
+    if _sys.maxint > 2 ** 32:
+        return False
+    return True
+
+
 def onlyOn32Bit(function):
     """
     Usage::
@@ -97,7 +107,7 @@
 
     The test runs only on 32-bit systems
     """
-    if _sys.maxint > 2 ** 32:
+    if not is32Bit():
         if _sys.version_info[:2] >= (2, 7):
             return _unittest.skip("only on 32-bit")(function)
         return None

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf