summaryrefslogtreecommitdiffstats
path: root/Tools/freeze/parsesetup.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-09-11 20:36:02 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2002-09-11 20:36:02 (GMT)
commitaaab30e00cc3e8d90c71b8657c284feeb4ac1413 (patch)
treed055e0bd374770014d9afdff1b961418b1828584 /Tools/freeze/parsesetup.py
parent6a0477b099560a452e37fe77c3850bf232487c16 (diff)
downloadcpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.zip
cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.gz
cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.bz2
Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py) This replaces string module functions with string methods for the stuff in the Tools directory. Several uses of string.letters etc. are still remaining.
Diffstat (limited to 'Tools/freeze/parsesetup.py')
-rw-r--r--Tools/freeze/parsesetup.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Tools/freeze/parsesetup.py b/Tools/freeze/parsesetup.py
index 7a6b72e..2b9123e 100644
--- a/Tools/freeze/parsesetup.py
+++ b/Tools/freeze/parsesetup.py
@@ -1,7 +1,6 @@
# Parse Makefiles and Python Setup(.in) files.
import re
-import string
# Extract variable definitions from a Makefile.
@@ -29,10 +28,10 @@ def getmakevars(filename):
continue
(name, value) = matchobj.group(1, 2)
# Strip trailing comment
- i = string.find(value, '#')
+ i = value.find('#')
if i >= 0:
value = value[:i]
- value = string.strip(value)
+ value = value.strip()
variables[name] = value
finally:
fp.close()
@@ -60,7 +59,7 @@ def getsetupinfo(filename):
if not line:
break
# Strip comments
- i = string.find(line, '#')
+ i = line.find('#')
if i >= 0:
line = line[:i]
if line.endswith('\\\n'):
@@ -69,9 +68,9 @@ def getsetupinfo(filename):
matchobj = setupvardef.match(line)
if matchobj:
(name, value) = matchobj.group(1, 2)
- variables[name] = string.strip(value)
+ variables[name] = value.strip()
else:
- words = string.split(line)
+ words = line.split()
if words:
modules[words[0]] = words[1:]
finally: