]> granicus.if.org Git - python/commitdiff
Remove the use of callable() in re to silence warnings under -3.
authorBrett Cannon <bcannon@gmail.com>
Mon, 4 Aug 2008 21:07:59 +0000 (21:07 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 4 Aug 2008 21:07:59 +0000 (21:07 +0000)
Lib/re.py

index 1d9c987c1cdc866f3f66bdb5e56c1ef8d6675e21..ee962bbc8f85bb4c94faa18ca5b8f2310d7f65bd 100644 (file)
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -316,7 +316,7 @@ class Scanner:
             if i == j:
                 break
             action = self.lexicon[m.lastindex-1][1]
-            if callable(action):
+            if hasattr(action, '__call__'):
                 self.match = m
                 action = action(self, m.group())
             if action is not None: