summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-07-13 06:15:11 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-07-13 06:15:11 (GMT)
commitdc9dcf135e7bde09726d0af5cd55f49c31851c66 (patch)
treecf85411e4d518f8111fb6b8adde65da655901966 /Lib/test/test_warnings.py
parent0320464583957258031ebee1b8897343211e4339 (diff)
downloadcpython-dc9dcf135e7bde09726d0af5cd55f49c31851c66.zip
cpython-dc9dcf135e7bde09726d0af5cd55f49c31851c66.tar.gz
cpython-dc9dcf135e7bde09726d0af5cd55f49c31851c66.tar.bz2
This test failed on WindowsME because the full file path did not get
reported consistently with the *nix world. 'Lib/test/test_warnings.py' came out as 'lib\test\test_warnings.py'. The basename is all we care about so I used that.
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r--Lib/test/test_warnings.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index 9e375e0..5e8574b 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -1,4 +1,5 @@
import warnings
+import os
# The warnings module isn't easily tested, because it relies on module
# globals to store configuration information. We need to extract the
@@ -8,8 +9,7 @@ _filters = []
_showwarning = None
def showwarning(message, category, filename, lineno, file=None):
- i = filename.find("Lib")
- filename = filename[i:]
+ filename = os.path.basename(filename)
print "%s:%s: %s: %s" % (filename, lineno, category.__name__, message)
def monkey():