[Python-checkins] CVS: python/dist/src/Lib/distutils/command build_ext.py,1.73,1.74
A.M. Kuchling
akuchling@users.sourceforge.net
Sat, 17 Mar 2001 12:15:43 -0800
Update of /cvsroot/python/python/dist/src/Lib/distutils/command
In directory usw-pr-cvs1:/tmp/cvs-serv2273
Modified Files:
build_ext.py
Log Message:
Fix bug #233253: the --define and --undef options didn't work, whether
specified on the command-line or in setup.cfg. The option processing
leaves them as strings, but they're supposed to be lists.
Index: build_ext.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_ext.py,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -r1.73 -r1.74
*** build_ext.py 2001/03/10 09:33:14 1.73
--- build_ext.py 2001/03/17 20:15:41 1.74
***************
*** 178,181 ****
--- 178,196 ----
self.library_dirs.append('.')
+ # The argument parsing will result in self.define being a string, but
+ # it has to be a list of 2-tuples. All the preprocessor symbols
+ # specified by the 'define' option will be set to '1'. Multiple
+ # symbols can be separated with commas.
+
+ if self.define:
+ defines = string.split(self.define, ',')
+ self.define = map(lambda symbol: (symbol, '1'), defines)
+
+ # The option for macros to undefine is also a string from the
+ # option parsing, but has to be a list. Multiple symbols can also
+ # be separated with commas here.
+ if self.undef:
+ self.undef = string.split(self.undef, ',')
+
# finalize_options ()