changeset 25659:d60678a567a9

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 23 Jun 2015 22:38:21 -0700
parents e93036747902
children 328739ea70c3
files contrib/check-code.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Tue Jun 23 22:30:33 2015 -0700
+++ b/contrib/check-code.py	Tue Jun 23 22:38:21 2015 -0700
@@ -288,6 +288,7 @@
     (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
   [