contrib/check-code.py
changeset 16428 9b26d541e972
parent 16413 1a420761fcb7
parent 16416 c3aedd526d53
child 16483 3c4910364797
equal deleted inserted replaced
16427:d54d4de56aa7 16428:9b26d541e972
   178     (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
   178     (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
   179     (r' [=!]=\s+(True|False|None)',
   179     (r' [=!]=\s+(True|False|None)',
   180      "comparison with singleton, use 'is' or 'is not' instead"),
   180      "comparison with singleton, use 'is' or 'is not' instead"),
   181     (r'^\s*(while|if) [01]:',
   181     (r'^\s*(while|if) [01]:',
   182      "use True/False for constant Boolean expression"),
   182      "use True/False for constant Boolean expression"),
   183     (r'(?<!def)\s+hasattr',
   183     (r'(?:(?<!def)\s+|\()hasattr',
   184      'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
   184      'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
   185     (r'opener\([^)]*\).read\(',
   185     (r'opener\([^)]*\).read\(',
   186      "use opener.read() instead"),
   186      "use opener.read() instead"),
   187     (r'BaseException', 'not in Py2.4, use Exception'),
   187     (r'BaseException', 'not in Py2.4, use Exception'),
   188     (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'),
   188     (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'),