check-code: allow assignment to hasattr variable
authorYuya Nishihara <yuya@tcha.org>
Tue, 16 Aug 2016 17:15:54 +0900
changeset 29796 6ab838b20359
parent 29795 142ae01820a3
child 29797 965c91bad9e3
check-code: allow assignment to hasattr variable
contrib/check-code.py
--- a/contrib/check-code.py	Mon Aug 15 16:07:55 2016 +0900
+++ b/contrib/check-code.py	Tue Aug 16 17:15:54 2016 +0900
@@ -295,7 +295,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"),