From 9a5795f9d19bf36aec77d1454a284a3f64c2802f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 13 Jan 2006 16:59:46 +0000 Subject: Bug #1403410: The warnings module now doesn't get confused when it can't find out the module name it generates a warning for. --- Lib/warnings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/warnings.py') diff --git a/Lib/warnings.py b/Lib/warnings.py index 5eac60f7c5..8baac479cd 100644 --- a/Lib/warnings.py +++ b/Lib/warnings.py @@ -63,7 +63,7 @@ def warn(message, category=None, stacklevel=1): def warn_explicit(message, category, filename, lineno, module=None, registry=None): if module is None: - module = filename + module = filename or "" if module[-3:].lower() == ".py": module = module[:-3] # XXX What about leading pathname? if registry is None: -- cgit v1.2.1