mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +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
|
@ -10,8 +10,6 @@ We'll have to fix IDLE to do something reasonable when two or more
|
|||
extensions what to capture the same event.
|
||||
"""
|
||||
|
||||
import string
|
||||
|
||||
import PyParse
|
||||
from AutoIndent import AutoIndent, index2line
|
||||
from IdleConf import idleconf
|
||||
|
@ -177,10 +175,10 @@ class LastOpenBracketFinder:
|
|||
if i is None \
|
||||
or keysym_type(buf[i]) != right_keysym_type:
|
||||
return None
|
||||
lines_back = string.count(buf[i:], "\n") - 1
|
||||
lines_back = buf[i:].count("\n") - 1
|
||||
# subtract one for the "\n" added to please the parser
|
||||
upto_open = buf[:i]
|
||||
j = string.rfind(upto_open, "\n") + 1 # offset of column 0 of line
|
||||
j = upto_open.rfind("\n") + 1 # offset of column 0 of line
|
||||
offset = i - j
|
||||
return "%d.%d" % (lno - lines_back, offset)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue