diff options
author | Greg Ward <gward@python.net> | 1999-12-12 17:01:01 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 1999-12-12 17:01:01 (GMT) |
commit | 48697d931bb86ddd114a42ccb89adb6374aef4ff (patch) | |
tree | fe14bcfb05fadc4b202448247934b311cdd5440f /Lib | |
parent | 04d78328f39864cada04591ebb1d99ad30671cec (diff) | |
download | cpython-48697d931bb86ddd114a42ccb89adb6374aef4ff.zip cpython-48697d931bb86ddd114a42ccb89adb6374aef4ff.tar.gz cpython-48697d931bb86ddd114a42ccb89adb6374aef4ff.tar.bz2 |
Changed 'build_extensions()' so 'sources' can be a list or tuple; and
call CCompiler method 'compile()' with 'include_dirs' not 'includes'.
Fixed stupid typo in 'get_source_files()'.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index f284092..d38cb18 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -179,7 +179,7 @@ class BuildExt (Command): filenames = [] # Wouldn't it be neat if we knew the names of header files too... - for (extension_name, build_info) in extensions: + for (extension_name, build_info) in self.extensions: sources = build_info.get ('sources') if type (sources) in (ListType, TupleType): filenames.extend (sources) @@ -191,10 +191,11 @@ class BuildExt (Command): for (extension_name, build_info) in extensions: sources = build_info.get ('sources') - if sources is None or type (sources) is not ListType: + if sources is None or type (sources) not in (ListType, TupleType): raise DistutilsValueError, \ "in ext_modules option, 'sources' must be present " + \ "and must be a list of source filenames" + sources = list (sources) # First step: compile the source code to object files. This # drops the object files in the current directory, regardless @@ -205,7 +206,7 @@ class BuildExt (Command): include_dirs = build_info.get ('include_dirs') self.compiler.compile (sources, macros=macros, - includes=include_dirs) + include_dirs=include_dirs) # Now link the object files together into a "shared object" -- # of course, first we have to figure out all the other things |