Submitter | Yuya Nishihara |
---|---|
Date | Aug. 16, 2016, 8:50 a.m. |
Message ID | <2a4b9fa66b0b568c50e2.1471337442@mimosa> |
Download | mbox | patch |
Permalink | /patch/16318/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -295,7 +295,7 @@ pypats = [ "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"),