Mercurial > hg-stable
changeset 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 | 142ae01820a3 |
children | 965c91bad9e3 |
files | contrib/check-code.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
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"),