diff options
author | Brett Cannon <bcannon@gmail.com> | 2004-12-07 03:25:18 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2004-12-07 03:25:18 (GMT) |
commit | 84667c063a1e93a985134f7cef376edf82941c02 (patch) | |
tree | 04ea49ba40272d175f7ae7dd5a3253d00887d3b3 /setup.py | |
parent | 516592f4ff13ee39ebd115088c7429631328e2db (diff) | |
download | cpython-84667c063a1e93a985134f7cef376edf82941c02.zip cpython-84667c063a1e93a985134f7cef376edf82941c02.tar.gz cpython-84667c063a1e93a985134f7cef376edf82941c02.tar.bz2 |
Change code in setup.py for parsing LDFLAGS and CPPFLAGS to use optparse
instead of getopt. Required making use of gettext._ as optional (optparse
changed OK'ed by Greg Ward in private email).
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -3,7 +3,7 @@ __version__ = "$Revision$" -import sys, os, imp, re, getopt +import sys, os, imp, re, optparse from distutils import log from distutils import sysconfig @@ -253,11 +253,10 @@ class PyBuildExt(build_ext): ('CPPFLAGS', '-I', self.compiler.include_dirs)): env_val = os.getenv(env_var) if env_val: - # getopt is used instead of optparse because the latter imports - # gettext which imports struct which has not been built yet - # when this method is needed - options = getopt.getopt(env_val.split(), arg_name[1] + ':')[0] - for arg_option, directory in options: + parser = optparse.OptionParser() + parser.add_option(arg_name, dest="dirs", action="append") + options = parser.parse_args(env_val.split())[0] + for directory in options.dirs: add_dir_to_list(dir_list, directory) if os.path.normpath(sys.prefix) != '/usr': |