]> granicus.if.org Git - python/commitdiff
Merged revisions 77466 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 16 Jan 2010 18:05:15 +0000 (18:05 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 16 Jan 2010 18:05:15 +0000 (18:05 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77466 | antoine.pitrou | 2010-01-13 12:47:49 +0100 (mer., 13 janv. 2010) | 5 lines

  Issue #7661: Allow ctypes to be built from a non-ASCII directory path.
  Patch by Florent Xicluna.
........

Misc/NEWS
Modules/_ctypes/libffi/fficonfig.py.in
setup.py

index eb77a3db311ddd88110db004b85c734b2fee959e..b9ea47547da48fad20e6c652316ea9de197d2a17 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -167,6 +167,9 @@ Library
 Build
 -----
 
+- Issue #7661: Allow ctypes to be built from a non-ASCII directory path.
+  Patch by Florent Xicluna.
+
 - Issue #7589: Only build the nis module when the correct header files are
   found.
 
index 10293273588b1be8ccbfd0b4fec931af5123e389..045d7c3b8d9445440ebd9ef1f03ea043b5c2db2d 100644 (file)
@@ -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@'
index f897a8ea968b5baec680325ecb74485366e73ed2..d0826ce41c50165fa41ae5f58bb880f9a0c8c385 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -814,7 +814,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)
@@ -1712,17 +1712,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.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