Closes #13258: Use callable() built-in in the standard library.
diff --git a/Lib/re.py b/Lib/re.py
index abd7ea2..4fe3bd8 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -326,7 +326,7 @@
             if i == j:
                 break
             action = self.lexicon[m.lastindex-1][1]
-            if hasattr(action, "__call__"):
+            if callable(action):
                 self.match = m
                 action = action(self, m.group())
             if action is not None: