comparison contrib/check-code.py @ 15334:24856af7237c stable

check-code: catch BaseException and os.path.relpath
author Matt Mackall <mpm@selenic.com>
date Fri, 21 Oct 2011 16:52:23 -0500
parents 4b71c17caeb8
children 572c22c88be6
comparison
equal deleted inserted replaced
15333:f37b71fec602 15334:24856af7237c
174 "use True/False for constant Boolean expression"), 174 "use True/False for constant Boolean expression"),
175 (r'(?<!def)\s+hasattr', 175 (r'(?<!def)\s+hasattr',
176 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'), 176 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
177 (r'opener\([^)]*\).read\(', 177 (r'opener\([^)]*\).read\(',
178 "use opener.read() instead"), 178 "use opener.read() instead"),
179 (r'BaseException', 'not in Py2.4, use Exception'),
180 (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'),
179 (r'opener\([^)]*\).write\(', 181 (r'opener\([^)]*\).write\(',
180 "use opener.write() instead"), 182 "use opener.write() instead"),
181 (r'[\s\(](open|file)\([^)]*\)\.read\(', 183 (r'[\s\(](open|file)\([^)]*\)\.read\(',
182 "use util.readfile() instead"), 184 "use util.readfile() instead"),
183 (r'[\s\(](open|file)\([^)]*\)\.write\(', 185 (r'[\s\(](open|file)\([^)]*\)\.write\(',