mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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.
This commit is contained in:
parent
6a0477b099
commit
aaab30e00c
70 changed files with 271 additions and 346 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue