From patchwork Tue Sep 16 15:59:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,2] check-code: look for misuse of __bool__ From: Yuya Nishihara X-Patchwork-Id: 5830 Message-Id: <161fd3b412acce6ff0d3.1410883167@mimosa> To: mercurial-devel@selenic.com Date: Wed, 17 Sep 2014 00:59:27 +0900 # HG changeset patch # User Yuya Nishihara # Date 1410881317 -32400 # Wed Sep 17 00:28:37 2014 +0900 # Node ID 161fd3b412acce6ff0d364d41618bd1a627b3877 # Parent 41ce9361751ce40497dcbf29ec2d84ef0fbc7593 check-code: look for misuse of __bool__ diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -299,6 +299,7 @@ pypats = [ (r'ui\.(status|progress|write|note|warn)\([\'\"]x', "missing _() in ui message (use () to hide false-positives)"), (r'release\(.*wlock, .*lock\)', "wrong lock release order"), + (r'\b__bool__\b', "__bool__ should be __nonzero__ in Python 2"), ], # warnings [