[PATCH 1 of 8] check-code: drop ban on callable() which was restored in Python 3.2

Augie Fackler raf at durin42.com
Tue Jun 24 13:37:37 CDT 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1403529773 14400
#      Mon Jun 23 09:22:53 2014 -0400
# Node ID f8c50a5f41dab292b81069fa3a898b070fd5b7fd
# Parent  15baed3f24ee98a7aaecfaf9b8c93e3695c9a813
check-code: drop ban on callable() which was restored in Python 3.2

A followup will restore use of callable() in place of the awkward
hasattr() construction we were using to be one step closer to Python
3.

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -247,8 +247,6 @@
     (r'^\s*os\.path\.relpath', "relpath not available in Python 2.4"),
     (r'(?<!def)\s+(any|all|format)\(',
      "any/all/format not available in Python 2.4", 'no-py24'),
-    (r'(?<!def)\s+(callable)\(',
-     "callable not available in Python 3, use getattr(f, '__call__', None)"),
     (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
     (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist),
      "gratuitous whitespace after Python keyword"),


More information about the Mercurial-devel mailing list