Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 29807:6ab838b20359
check-code: allow assignment to hasattr variable
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 16 Aug 2016 17:15:54 +0900 |
parents | 24991e7f775f |
children | 01703a8b8a46 |
line wrap: on
line diff
--- 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"),