mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Merged revisions 64549 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r64549 | brett.cannon | 2008-06-26 17:31:13 -0700 (Thu, 26 Jun 2008) | 7 lines warnings.warn_explicit() did not have the proper TypeErrors in place to prevent bus errors or SystemError being raised. As a side effect of fixing this, a bad DECREF that could be triggered when 'message' and 'category' were both None was fixed. Closes issue 3211. Thanks JP Calderone for the bug report. ........
This commit is contained in:
parent
429ef650b7
commit
db7349128f
4 changed files with 34 additions and 5 deletions
|
@ -188,6 +188,7 @@ def warn(message, category=None, stacklevel=1):
|
|||
|
||||
def warn_explicit(message, category, filename, lineno,
|
||||
module=None, registry=None, module_globals=None):
|
||||
lineno = int(lineno)
|
||||
if module is None:
|
||||
module = filename or "<unknown>"
|
||||
if module[-3:].lower() == ".py":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue