Closes #13258: Use callable() built-in in the standard library.
diff --git a/Lib/warnings.py b/Lib/warnings.py
index 5b5821b..edbbb5e 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -259,7 +259,7 @@
         raise RuntimeError(
               "Unrecognized action (%r) in warnings.filters:\n %s" %
               (action, item))
-    if not hasattr(showwarning, "__call__"):
+    if not callable(showwarning):
         raise TypeError("warnings.showwarning() must be set to a "
                         "function or method")
     # Print message and context