mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +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
|
@ -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]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue