contrib/check-code.py
changeset 25010 ded7302e1c83
parent 24836 1f9127c9239b
child 25028 62c2786b4327
equal deleted inserted replaced
25009:e1fb276d4619 25010:ded7302e1c83
   279     (r'(?:(?<!def)\s+|\()hasattr',
   279     (r'(?:(?<!def)\s+|\()hasattr',
   280      'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
   280      'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
   281     (r'opener\([^)]*\).read\(',
   281     (r'opener\([^)]*\).read\(',
   282      "use opener.read() instead"),
   282      "use opener.read() instead"),
   283     (r'BaseException', 'not in Python 2.4, use Exception'),
   283     (r'BaseException', 'not in Python 2.4, use Exception'),
   284     (r'os\.path\.relpath', 'os.path.relpath is not in Python 2.5'),
       
   285     (r'opener\([^)]*\).write\(',
   284     (r'opener\([^)]*\).write\(',
   286      "use opener.write() instead"),
   285      "use opener.write() instead"),
   287     (r'[\s\(](open|file)\([^)]*\)\.read\(',
   286     (r'[\s\(](open|file)\([^)]*\)\.read\(',
   288      "use util.readfile() instead"),
   287      "use util.readfile() instead"),
   289     (r'[\s\(](open|file)\([^)]*\)\.write\(',
   288     (r'[\s\(](open|file)\([^)]*\)\.write\(',