summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>1998-12-22 12:42:04 (GMT)
committerGreg Ward <gward@python.net>1998-12-22 12:42:04 (GMT)
commit3c8e54bf6220cd89ec80839161926db9a92e00ba (patch)
tree81f9c538905939156e8d0f7098e58557b3abf8a1 /Lib
parent9c30c24bc2285438dbe94c28c05f1aa9127a04a3 (diff)
downloadcpython-3c8e54bf6220cd89ec80839161926db9a92e00ba.zip
cpython-3c8e54bf6220cd89ec80839161926db9a92e00ba.tar.gz
cpython-3c8e54bf6220cd89ec80839161926db9a92e00ba.tar.bz2
Applied Fred's patch to fix the bugs that John Skaller noticed.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/sysconfig.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index b5fe187..3eee9b3 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -15,6 +15,7 @@ __version__ = "$Revision$"
def _init_posix():
import os
import re
+ import string
import sys
g = globals()
@@ -35,10 +36,9 @@ def _init_posix():
m = define_rx.match(line)
if m:
n, v = m.group(1, 2)
- if v == "1":
- g[n] = 1
- else:
- g[n] = v
+ try: v = string.atoi(v)
+ except ValueError: pass
+ g[n] = v
else:
m = undef_rx.match(line)
if m:
@@ -57,9 +57,12 @@ def _init_posix():
m = variable_rx.match(line)
if m:
n, v = m.group(1, 2)
+ v = string.strip(v)
if "$" in v:
notdone[n] = v
else:
+ try: v = string.atoi(v)
+ except ValueError: pass
done[n] = v
# do variable interpolation here
@@ -79,7 +82,9 @@ def _init_posix():
if "$" in after:
notdone[name] = value
else:
- done[name] = value
+ try: value = string.atoi(value)
+ except ValueError: pass
+ done[name] = string.strip(value)
del notdone[name]
elif notdone.has_key(n):
# get it on a subsequent round
@@ -91,9 +96,12 @@ def _init_posix():
if "$" in after:
notdone[name] = value
else:
- done[name] = value
+ try: value = string.atoi(value)
+ except ValueError: pass
+ done[name] = string.strip(value)
del notdone[name]
else:
+ # bogus variable reference; just drop it since we can't deal
del notdone[name]
# save the results in the global dictionary