summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_warnings.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-04-13 17:41:31 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-04-13 17:41:31 (GMT)
commitc477427eba42b52cd8217a6c19d4ce6fff284caf (patch)
tree7a766f30e8629ef8879dfcf1d4fbf7cb2c74e2b0 /Lib/test/test_warnings.py
parent25bb8182c61fc33e01a2781869402802b12747f1 (diff)
downloadcpython-c477427eba42b52cd8217a6c19d4ce6fff284caf.zip
cpython-c477427eba42b52cd8217a6c19d4ce6fff284caf.tar.gz
cpython-c477427eba42b52cd8217a6c19d4ce6fff284caf.tar.bz2
Fix spliting on colons on Windows machines with a file path by limiting the
number of splits.
Diffstat (limited to 'Lib/test/test_warnings.py')
-rw-r--r--Lib/test/test_warnings.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index 730452f..fb6aabb 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -328,9 +328,7 @@ class _WarningsTests(BaseTest):
"Too many newlines in %r" % result)
first_line, second_line = result.split('\n', 1)
expected_file = os.path.splitext(warning_tests.__file__)[0] + '.py'
- first_line_parts = first_line.split(':')
- self.assertEquals(len(first_line_parts), 4,
- "%r does not split into 4 parts" % first_line)
+ first_line_parts = first_line.rsplit(':', 3)
path, line, warning_class, message = first_line_parts
line = int(line)
self.failUnlessEqual(expected_file, path)