mirror of
https://github.com/python/cpython.git
synced 2025-10-26 19:24:34 +00:00
Use string.ascii_letters instead of string.letters (SF bug #226706).
Move computation of sets of characters out of the body of the function that uses them.
This commit is contained in:
parent
0f715d2aa1
commit
cd694c44a9
2 changed files with 9 additions and 3 deletions
|
|
@ -36,6 +36,9 @@ def linecache_checkcache(orig_checkcache=linecache.checkcache):
|
|||
linecache.checkcache = linecache_checkcache
|
||||
|
||||
|
||||
IDENTCHARS = string.ascii_letters + string.digits + "_"
|
||||
|
||||
|
||||
# Note: <<newline-and-indent>> event is defined in AutoIndent.py
|
||||
|
||||
#$ event <<plain-newline-and-indent>>
|
||||
|
|
@ -217,7 +220,7 @@ def showsyntaxerror(self, filename=None):
|
|||
text.tag_add("ERROR", pos)
|
||||
text.see(pos)
|
||||
char = text.get(pos)
|
||||
if char and char in string.letters + string.digits + "_":
|
||||
if char and char in IDENTCHARS:
|
||||
text.tag_add("ERROR", pos + " wordstart", pos)
|
||||
self.tkconsole.resetoutput()
|
||||
self.write("SyntaxError: %s\n" % str(msg))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue