contrib/check-code.py
branchstable
changeset 19501 725507cd5216
parent 19494 3119dc155ac2
child 19626 cf6b086d64cc
--- a/contrib/check-code.py	Thu Jul 25 10:42:36 2013 -0400
+++ b/contrib/check-code.py	Thu Jul 25 10:44:51 2013 -0400
@@ -173,6 +173,8 @@
     (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
     (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
      r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'),
+    (r'(?<!def)(\s+|^|\()next\(.+\)',
+     'no next(foo) in Python 2.4 and 2.5, use foo.next() instead'),
     (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'
      r'((?:\n|\1\s.*\n)+?)\1finally:',
      'no yield inside try/finally in Python 2.4'),