summaryrefslogtreecommitdiffstats
path: root/Lib/warnings.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r--Lib/warnings.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py
index 59011ca..14466d3 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -262,24 +262,6 @@ def warn_explicit(message, category, filename, lineno,
raise RuntimeError(
"Unrecognized action (%r) in warnings.filters:\n %s" %
(action, item))
- # Warn if showwarning() does not support the 'line' argument.
- # Don't use 'inspect' as it relies on an extension module, which break the
- # build thanks to 'warnings' being imported by setup.py.
- fxn_code = None
- if hasattr(showwarning, 'func_code'):
- fxn_code = showwarning.func_code
- elif hasattr(showwarning, '__func__'):
- fxn_code = showwarning.__func__.func_code
- if fxn_code:
- args = fxn_code.co_varnames[:fxn_code.co_argcount]
- CO_VARARGS = 0x4
- if 'line' not in args and not fxn_code.co_flags & CO_VARARGS:
- showwarning_msg = ("functions overriding warnings.showwarning() "
- "must support the 'line' argument")
- if message == showwarning_msg:
- _show_warning(message, category, filename, lineno)
- else:
- warn(showwarning_msg, DeprecationWarning)
# Print message and context
showwarning(message, category, filename, lineno)