diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-13 11:47:49 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-13 11:47:49 (GMT) |
commit | 8c510e704e3823df66c2c3ad85912c9a9dda7f14 (patch) | |
tree | 0de13fab14e4bef327f2b9083f32d689da9e9349 | |
parent | 5c767c2f876a0e9611489033b1be92c566273d6f (diff) | |
download | cpython-8c510e704e3823df66c2c3ad85912c9a9dda7f14.zip cpython-8c510e704e3823df66c2c3ad85912c9a9dda7f14.tar.gz cpython-8c510e704e3823df66c2c3ad85912c9a9dda7f14.tar.bz2 |
Issue #7661: Allow ctypes to be built from a non-ASCII directory path.
Patch by Florent Xicluna.
-rw-r--r-- | Misc/NEWS | 6 | ||||
-rw-r--r-- | Modules/_ctypes/libffi/fficonfig.py.in | 2 | ||||
-rw-r--r-- | setup.py | 11 |
3 files changed, 12 insertions, 7 deletions
@@ -39,6 +39,12 @@ Library Extension extra options may change the output without changing the .c file). Initial patch by Collin Winter. +Build +----- + +- Issue #7661: Allow ctypes to be built from a non-ASCII directory path. + Patch by Florent Xicluna. + What's New in Python 2.7 alpha 2? ================================= diff --git a/Modules/_ctypes/libffi/fficonfig.py.in b/Modules/_ctypes/libffi/fficonfig.py.in index 1029327..045d7c3 100644 --- a/Modules/_ctypes/libffi/fficonfig.py.in +++ b/Modules/_ctypes/libffi/fficonfig.py.in @@ -28,8 +28,6 @@ ffi_platforms = { 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'], } -ffi_srcdir = '@srcdir@' ffi_sources += ffi_platforms['@TARGET@'] -ffi_sources = [os.path.join('@srcdir@', f) for f in ffi_sources] ffi_cflags = '@CFLAGS@' @@ -813,7 +813,7 @@ class PyBuildExt(build_ext): print "being ignored (4.6.x must be >= 4.6.21)" continue - if ( (not db_ver_inc_map.has_key(db_ver)) and + if ( (db_ver not in db_ver_inc_map) and allow_db_ver(db_ver) ): # save the include directory with the db.h version # (first occurrence only) @@ -1732,17 +1732,18 @@ class PyBuildExt(build_ext): return False fficonfig = {} - execfile(ffi_configfile, globals(), fficonfig) - ffi_srcdir = os.path.join(fficonfig['ffi_srcdir'], 'src') + exec open(ffi_configfile) in fficonfig # Add .S (preprocessed assembly) to C compiler source extensions. self.compiler_obj.src_extensions.append('.S') include_dirs = [os.path.join(ffi_builddir, 'include'), - ffi_builddir, ffi_srcdir] + ffi_builddir, + os.path.join(ffi_srcdir, 'src')] extra_compile_args = fficonfig['ffi_cflags'].split() - ext.sources.extend(fficonfig['ffi_sources']) + ext.sources.extend(os.path.join(ffi_srcdir, f) for f in + fficonfig['ffi_sources']) ext.include_dirs.extend(include_dirs) ext.extra_compile_args.extend(extra_compile_args) return True |