# HG changeset patch # User Yuya Nishihara <y...@tcha.org> # Date 1471335354 -32400 # Tue Aug 16 17:15:54 2016 +0900 # Node ID 2a4b9fa66b0b568c50e2069b44cf01ea79eba6df # Parent 780d6b210b5fb0087a532aee0583f4d23af1f1d6 check-code: allow assignment to hasattr variable
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"), _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel