From: Ned Deily Date: Wed, 7 Dec 2011 09:08:35 +0000 (-0800) Subject: Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..". X-Git-Tag: v3.2.3rc1~306 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f0ad742b5c13d79aa4e3c2e935cfbe04f1e9a08;p=python Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..". (Patch by Tal Einat) --- diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py index ab69b8ac56..29b4640967 100644 --- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/ColorDelegator.py @@ -20,10 +20,10 @@ def make_pat(): # 1st 'file' colorized normal, 2nd as builtin, 3rd as string builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b" comment = any("COMMENT", [r"#[^\n]*"]) - sqstring = r"(\b[rRuU])?'[^'\\\n]*(\\.[^'\\\n]*)*'?" - dqstring = r'(\b[rRuU])?"[^"\\\n]*(\\.[^"\\\n]*)*"?' - sq3string = r"(\b[rRuU])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?" - dq3string = r'(\b[rRuU])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?' + sqstring = r"(\b[rRbB])?'[^'\\\n]*(\\.[^'\\\n]*)*'?" + dqstring = r'(\b[rRbB])?"[^"\\\n]*(\\.[^"\\\n]*)*"?' + sq3string = r"(\b[rRbB])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?" + dq3string = r'(\b[rRbB])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?' string = any("STRING", [sq3string, dq3string, sqstring, dqstring]) return kw + "|" + builtin + "|" + comment + "|" + string +\ "|" + any("SYNC", [r"\n"]) diff --git a/Misc/ACKS b/Misc/ACKS index 4effde36af..0f921658d6 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -256,6 +256,7 @@ Hans Eckardt Rodolpho Eckhardt Grant Edwards John Ehresman +Tal Einat Eric Eisner Andrew Eland Julien Élie diff --git a/Misc/NEWS b/Misc/NEWS index 8640d70c45..91fae4505b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -90,6 +90,9 @@ Core and Builtins Library ------- +- Issue #8641: Update IDLE 3 syntax coloring to recognize b".." and not u"..". + Patch by Tal Einat. + - tarfile.py: Correctly detect bzip2 compressed streams with blocksizes other than 900k.