Benjamin Peterson  committed 4b19b41

Make the Python implementation of warnings compatible with the C implementation regarding non-callable showwarning

  • Participants
  • Parent commits 9130b48
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/

                 _show_warning(message, category, filename, lineno)
                 warn(showwarning_msg, DeprecationWarning)
+    if not callable(showwarning):
+        raise TypeError("warnings.showwarning() must be set to a "
+                        "function or method")
     # Print message and context
     showwarning(message, category, filename, lineno)