# HG changeset patch # User Eli Collins # Date 1309220056 14400 # Node ID 38ab79522755f5a7af73f09a37e0fef0c97d2d47 # Parent 39fadb0255cd55d3292b4da4e53fb1a5966211ec change packaging.config._pop_values() to use ';' as environment marker separator (#12424) diff -r 39fadb0255cd -r 38ab79522755 Lib/packaging/config.py --- a/Lib/packaging/config.py Mon Jun 27 18:25:06 2011 -0500 +++ b/Lib/packaging/config.py Mon Jun 27 20:14:16 2011 -0400 @@ -17,18 +17,19 @@ def _pop_values(values_dct, key): - """Remove values from the dictionary and convert them as a list""" + """Remove values from the dictionary and convert them to a list""" vals_str = values_dct.pop(key, '') if not vals_str: return fields = [] # the line separator is \n for setup.cfg files for field in vals_str.split('\n'): - tmp_vals = field.split('--') - if len(tmp_vals) == 2 and not interpret(tmp_vals[1]): - continue - fields.append(tmp_vals[0]) - # Get bash options like `gcc -print-file-name=libgcc.a` XXX bash options? + if ';' in field: + field, marker = field.rsplit(';', 1) + if not interpret(marker): + continue + fields.append(field) + # parse string into arglist using shlex POSIX rules vals = split(' '.join(fields)) if vals: return vals diff -r 39fadb0255cd -r 38ab79522755 Lib/packaging/tests/test_config.py --- a/Lib/packaging/tests/test_config.py Mon Jun 27 18:25:06 2011 -0500 +++ b/Lib/packaging/tests/test_config.py Mon Jun 27 20:14:16 2011 -0400 @@ -110,8 +110,9 @@ sources = c_src/speed_coconuts.c extra_link_args = "`gcc -print-file-name=libgcc.a`" -shared define_macros = HAVE_CAIRO HAVE_GTK2 -libraries = gecodeint gecodekernel -- sys.platform != 'win32' - GecodeInt GecodeKernel -- sys.platform == 'win32' +libraries = + gecodeint gecodekernel ; sys.platform != 'win32' + GecodeInt GecodeKernel ; sys.platform == 'win32' [extension=fast_taunt] name = two.fast_taunt @@ -120,8 +121,8 @@ include_dirs = /usr/include/gecode /usr/include/blitz extra_compile_args = -fPIC -O2 - -DGECODE_VERSION=$(./gecode_version) -- sys.platform != 'win32' - /DGECODE_VERSION='win32' -- sys.platform == 'win32' + -DGECODE_VERSION=$(./gecode_version) ; sys.platform != 'win32' + /DGECODE_VERSION='win32' ; sys.platform == 'win32' language = cxx """