[Python-checkins] r42028 - in python/trunk: Lib/warnings.py Misc/NEWS

georg.brandl python-checkins at python.org
Fri Jan 13 17:59:47 CET 2006


Author: georg.brandl
Date: Fri Jan 13 17:59:46 2006
New Revision: 42028

Modified:
   python/trunk/Lib/warnings.py
   python/trunk/Misc/NEWS
Log:
Bug #1403410: The warnings module now doesn't get confused
when it can't find out the module name it generates a warning for.


Modified: python/trunk/Lib/warnings.py
==============================================================================
--- python/trunk/Lib/warnings.py	(original)
+++ python/trunk/Lib/warnings.py	Fri Jan 13 17:59:46 2006
@@ -63,7 +63,7 @@
 def warn_explicit(message, category, filename, lineno,
                   module=None, registry=None):
     if module is None:
-        module = filename
+        module = filename or "<unknown>"
         if module[-3:].lower() == ".py":
             module = module[:-3] # XXX What about leading pathname?
     if registry is None:

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri Jan 13 17:59:46 2006
@@ -335,6 +335,9 @@
 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 #1157027: cookielib mishandles RFC 2109 cookies in Netscape mode


More information about the Python-checkins mailing list