# HG changeset patch # User Gregory Szorc # Date 2015-06-24 05:38:21 # Node ID d60678a567a9be275a7bb90c4031f41d92157050 # Parent e930367479020f3111969852d2082e3342fa32bd check-code: detect legacy octal syntax Now that we have mass rewriting all files to use the modern octal syntax, detect and ban the legacy syntax, which is no longer supported in Python 3. diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -288,6 +288,7 @@ pypats = [ (r'\b__bool__\b', "__bool__ should be __nonzero__ in Python 2"), (r'os\.path\.join\(.*, *(""|\'\')\)', "use pathutil.normasprefix(path) instead of os.path.join(path, '')"), + (r'\s0[0-7]+\b', 'legacy octal syntax; use "0o" prefix instead of "0"'), ], # warnings [