Submitter | Siddharth Agarwal |
---|---|
Date | May 21, 2017, 8:47 p.m. |
Message ID | <5e82c2bdd3331c097629.1495399676@devvm31800.prn1.facebook.com> |
Download | mbox | patch |
Permalink | /patch/20801/ |
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 @@ -300,7 +300,8 @@ pypats = [ (r'^\s*(while|if) [01]:', "use True/False for constant Boolean expression"), (r'(?:(?<!def)\s+|\()hasattr\(', - 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'), + 'hasattr(foo, bar) is broken on py2, use util.safehasattr(foo, bar) ' + 'instead', r'#.*hasattr-py3-only'), (r'opener\([^)]*\).read\(', "use opener.read() instead"), (r'opener\([^)]*\).write\(',