[Python-checkins] cpython (merge 3.2 -> default): Merge with 3.2 #6528 None, True, False are keywords in 3.x. Patch by R. Serwy.

terry.reedy python-checkins at python.org
Mon Jan 16 09:23:03 CET 2012


http://hg.python.org/cpython/rev/522f07bfa067
changeset: 74437:522f07bfa067
parent: 74435:f1408e41e306
parent: 74436:2d4ce2cdd6d4
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Mon Jan 16 03:22:33 2012 -0500
summary:
 Merge with 3.2 #6528 None, True, False are keywords in 3.x. Patch by R. Serwy.
files:
 Lib/idlelib/ColorDelegator.py | 3 ++-
 Lib/idlelib/configDialog.py | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py
--- a/Lib/idlelib/ColorDelegator.py
+++ b/Lib/idlelib/ColorDelegator.py
@@ -15,7 +15,8 @@
 def make_pat():
 kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b"
 builtinlist = [str(name) for name in dir(builtins)
- if not name.startswith('_')]
+ if not name.startswith('_') and \
+ name not in keyword.kwlist]
 # self.file = open("file") :
 # 1st 'file' colorized normal, 2nd as builtin, 3rd as string
 builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -199,7 +199,7 @@
 ("'string'",'string'),('\n var1 = ','normal'),("'selected'",'hilite'),
 ('\n var2 = ','normal'),("'found'",'hit'),
 ('\n var3 = ','normal'),('list', 'builtin'), ('(','normal'),
- ('None', 'builtin'),(')\n\n','normal'),
+ ('None', 'keyword'),(')\n\n','normal'),
 (' error ','error'),(' ','normal'),('cursor |','cursor'),
 ('\n ','normal'),('shell','console'),(' ','normal'),('stdout','stdout'),
 (' ','normal'),('stderr','stderr'),('\n','normal'))
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /