mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Closes #13258: Use callable() built-in in the standard library.
This commit is contained in:
parent
f99e4b5dbe
commit
5d1155c08e
25 changed files with 48 additions and 51 deletions
|
@ -259,7 +259,7 @@ def warn_explicit(message, category, filename, lineno,
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue