summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-13 12:04:20 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-13 12:04:20 (GMT)
commit72f4d646f5aecf258b0b71cd2288305819d50a0b (patch)
treed969c69639f316dcbb72d2c0b6de5e26d75ca18b /setup.py
parentaa92589c4d053759d336725fbc34dc057d10ff98 (diff)
downloadcpython-72f4d646f5aecf258b0b71cd2288305819d50a0b.zip
cpython-72f4d646f5aecf258b0b71cd2288305819d50a0b.tar.gz
cpython-72f4d646f5aecf258b0b71cd2288305819d50a0b.tar.bz2
Note: I'm merging these changes out of consistency, but they don't seem
to be needed in py3k (except perhaps for non-utf8 paths). Merged revisions 77466-77467 via svnmerge from 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. ........ r77467 | antoine.pitrou | 2010-01-13 12:57:42 +0100 (mer., 13 janv. 2010) | 3 lines Use `with` ........
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/setup.py b/setup.py
index 0f7a1dc..635956b 100644
--- a/setup.py
+++ b/setup.py
@@ -1498,22 +1498,19 @@ class PyBuildExt(build_ext):
return False
fficonfig = {}
- fp = open(ffi_configfile)
- try:
- script = fp.read()
- finally:
- fp.close()
- exec(script, globals(), fficonfig)
- ffi_srcdir = os.path.join(fficonfig['ffi_srcdir'], 'src')
+ with open(ffi_configfile) as f:
+ exec(f.read(), globals(), 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