diff options
author | Fred Drake <fdrake@acm.org> | 2001-07-20 18:58:42 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-07-20 18:58:42 (GMT) |
commit | cd694c44a91fa20e6d2ee540e0b517021e845e79 (patch) | |
tree | 7ad24f37013f88e8ac081257c024d8db48a3ca27 /Tools/idle | |
parent | 0f715d2aa119d0391dd50919c04bfaa8a4452cf0 (diff) | |
download | cpython-cd694c44a91fa20e6d2ee540e0b517021e845e79.zip cpython-cd694c44a91fa20e6d2ee540e0b517021e845e79.tar.gz cpython-cd694c44a91fa20e6d2ee540e0b517021e845e79.tar.bz2 |
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.
Diffstat (limited to 'Tools/idle')
-rw-r--r-- | Tools/idle/PyShell.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index bd34d18..03b4684 100644 --- a/Tools/idle/PyShell.py +++ b/Tools/idle/PyShell.py @@ -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 @@ class ModifiedInterpreter(InteractiveInterpreter): 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)) |