Commit 4edd989e authored by Georg Brandl's avatar Georg Brandl

Bug #1403410: The warnings module now doesn't get confused

when it can't find out the module name it generates a warning for.
parent a28ad778
...@@ -63,7 +63,7 @@ def warn(message, category=None, stacklevel=1): ...@@ -63,7 +63,7 @@ def warn(message, category=None, stacklevel=1):
def warn_explicit(message, category, filename, lineno, def warn_explicit(message, category, filename, lineno,
module=None, registry=None): module=None, registry=None):
if module is None: if module is None:
module = filename module = filename or "<unknown>"
if module[-3:].lower() == ".py": if module[-3:].lower() == ".py":
module = module[:-3] # XXX What about leading pathname? module = module[:-3] # XXX What about leading pathname?
if registry is None: if registry is None:
......
...@@ -335,6 +335,9 @@ Extension Modules ...@@ -335,6 +335,9 @@ Extension Modules
Library Library
------- -------
- Bug #1403410: The warnings module now doesn't get confused
when it can't find out the module name it generates a warning for.
- Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature. - Patch #1177307: Added a new codec utf_8_sig for UTF-8 with a BOM signature.
- Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode - Patch #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment