diff options
author | Walter Dörwald <walter@livinglogic.de> | 2002-09-11 20:36:02 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2002-09-11 20:36:02 (GMT) |
commit | aaab30e00cc3e8d90c71b8657c284feeb4ac1413 (patch) | |
tree | d055e0bd374770014d9afdff1b961418b1828584 /Tools/scripts/fixcid.py | |
parent | 6a0477b099560a452e37fe77c3850bf232487c16 (diff) | |
download | cpython-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/scripts/fixcid.py')
-rwxr-xr-x | Tools/scripts/fixcid.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Tools/scripts/fixcid.py b/Tools/scripts/fixcid.py index 6f674c6..8bc1de0 100755 --- a/Tools/scripts/fixcid.py +++ b/Tools/scripts/fixcid.py @@ -36,7 +36,6 @@ import sys import regex -import string import os from stat import * import getopt @@ -213,11 +212,11 @@ Number = Floatnumber + '\|' + Intnumber # Anything else is an operator -- don't list this explicitly because of '/*' OutsideComment = (Identifier, Number, String, Char, CommentStart) -OutsideCommentPattern = '\(' + string.joinfields(OutsideComment, '\|') + '\)' +OutsideCommentPattern = '\(' + '\|'.join(OutsideComment) + '\)' OutsideCommentProgram = regex.compile(OutsideCommentPattern) InsideComment = (Identifier, Number, CommentEnd) -InsideCommentPattern = '\(' + string.joinfields(InsideComment, '\|') + '\)' +InsideCommentPattern = '\(' + '\|'.join(InsideComment) + '\)' InsideCommentProgram = regex.compile(InsideCommentPattern) def initfixline(): @@ -286,10 +285,10 @@ def addsubst(substfile): if not line: break lineno = lineno + 1 try: - i = string.index(line, '#') - except string.index_error: + i = line.index('#') + except ValueError: i = -1 # Happens to delete trailing \n - words = string.split(line[:i]) + words = line[:i].split() if not words: continue if len(words) == 3 and words[0] == 'struct': words[:2] = [words[0] + ' ' + words[1]] |