mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
Fix spliting on colons on Windows machines with a file path by limiting the
number of splits.
This commit is contained in:
parent
25bb8182c6
commit
c477427eba
1 changed files with 1 additions and 3 deletions
|
|
@ -328,9 +328,7 @@ class _WarningsTests(BaseTest):
|
||||||
"Too many newlines in %r" % result)
|
"Too many newlines in %r" % result)
|
||||||
first_line, second_line = result.split('\n', 1)
|
first_line, second_line = result.split('\n', 1)
|
||||||
expected_file = os.path.splitext(warning_tests.__file__)[0] + '.py'
|
expected_file = os.path.splitext(warning_tests.__file__)[0] + '.py'
|
||||||
first_line_parts = first_line.split(':')
|
first_line_parts = first_line.rsplit(':', 3)
|
||||||
self.assertEquals(len(first_line_parts), 4,
|
|
||||||
"%r does not split into 4 parts" % first_line)
|
|
||||||
path, line, warning_class, message = first_line_parts
|
path, line, warning_class, message = first_line_parts
|
||||||
line = int(line)
|
line = int(line)
|
||||||
self.failUnlessEqual(expected_file, path)
|
self.failUnlessEqual(expected_file, path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue