[pypy-svn] pypy default: Added failing test for issue 705 and checks inside modified-2.7/sysconfig.py to avoid the problem
berdario
commits-noreply at bitbucket.org
Sun May 1 20:11:17 CEST 2011
Author: Dario Bertini <berdario at gmail.com>
Branch:
Changeset: r43832:099a287513d0
Date: 2011-05-01 20:09 +0200
http://bitbucket.org/pypy/pypy/changeset/099a287513d0/
Log: Added failing test for issue 705 and checks inside
modified-2.7/sysconfig.py to avoid the problem
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