diff contrib/check-code.py @ 16416:c3aedd526d53 stable

mq: replace hasattr() with util.safehasattr(), update check-code.py
author Patrick Mezard <patrick@mezard.eu>
date Fri, 13 Apr 2012 15:07:13 +0200
parents f64b25f147d7
children 9b26d541e972
line wrap: on
line diff
--- a/contrib/check-code.py	Sun Apr 08 11:14:56 2012 +0200
+++ b/contrib/check-code.py	Fri Apr 13 15:07:13 2012 +0200
@@ -177,7 +177,7 @@
      "comparison with singleton, use 'is' or 'is not' instead"),
     (r'^\s*(while|if) [01]:',
      "use True/False for constant Boolean expression"),
-    (r'(?<!def)\s+hasattr',
+    (r'(?:(?<!def)\s+|\()hasattr',
      'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
     (r'opener\([^)]*\).read\(',
      "use opener.read() instead"),