[pypy-svn] pypy default: Merged upstream.

alex_gaynor commits-noreply at bitbucket.org
Sun May 1 21:12:59 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r43835:4b9a838b0bb7
Date: 2011-05-01 15:11 -0400
http://bitbucket.org/pypy/pypy/changeset/4b9a838b0bb7/

Log:	Merged upstream.

diff --git a/lib-python/modified-2.7/sysconfig.py b/lib-python/modified-2.7/sysconfig.py
--- a/lib-python/modified-2.7/sysconfig.py
+++ b/lib-python/modified-2.7/sysconfig.py
@@ -369,10 +369,11 @@
                         # patched up as well.
                         'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
 
-                        flags = _CONFIG_VARS[key]
-                        flags = re.sub('-arch\s+\w+\s', ' ', flags)
-                        flags = flags + ' ' + arch
-                        _CONFIG_VARS[key] = flags
+                        if key in _CONFIG_VARS: 
+                            flags = _CONFIG_VARS[key]
+                            flags = re.sub('-arch\s+\w+\s', ' ', flags)
+                            flags = flags + ' ' + arch
+                            _CONFIG_VARS[key] = flags
 
                 # If we're on OSX 10.5 or later and the user tries to
                 # compiles an extension using an SDK that is not present

diff --git a/lib-python/modified-2.7/test/test_sysconfig.py b/lib-python/modified-2.7/test/test_sysconfig.py
--- a/lib-python/modified-2.7/test/test_sysconfig.py
+++ b/lib-python/modified-2.7/test/test_sysconfig.py
@@ -210,13 +210,22 @@
 
         self.assertEqual(get_platform(), 'macosx-10.4-fat64')
 
-        for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
+        for arch in ('ppc', 'i386', 'ppc64', 'x86_64'):
             get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
                                            '/Developer/SDKs/MacOSX10.4u.sdk  '
                                            '-fno-strict-aliasing -fno-common '
                                            '-dynamic -DNDEBUG -g -O3'%(arch,))
 
             self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
+        
+        # macosx with ARCHFLAGS set and empty _CONFIG_VARS
+        os.environ['ARCHFLAGS'] = '-arch i386'
+        sysconfig._CONFIG_VARS = None
+        
+        # this will attempt to recreate the _CONFIG_VARS based on environment 
+        # variables; used to check a problem with the PyPy's _init_posix
+        # implementation; see: issue 705
+        get_config_vars() 
 
         # linux debian sarge
         os.name = 'posix'


More information about the Pypy-commit mailing list