Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9b25bb

Browse files
committed
Issue #23731: Fix tracemalloc test on Windows.
'a.pyo' can no longer match 'a.py', so 'a.PYO' can't either.
1 parent ad3e27a commit d9b25bb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/test/test_tracemalloc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,15 +671,13 @@ def fnmatch(filename, pattern):
671671
self.assertTrue(fnmatch('aBcDe', 'Ab*dE'))
672672

673673
self.assertTrue(fnmatch('a.pyc', 'a.PY'))
674-
self.assertTrue(fnmatch('a.PYO', 'a.py'))
675674
self.assertTrue(fnmatch('a.py', 'a.PYC'))
676675
else:
677676
# case sensitive
678677
self.assertFalse(fnmatch('aBC', 'ABc'))
679678
self.assertFalse(fnmatch('aBcDe', 'Ab*dE'))
680679

681680
self.assertFalse(fnmatch('a.pyc', 'a.PY'))
682-
self.assertFalse(fnmatch('a.PYO', 'a.py'))
683681
self.assertFalse(fnmatch('a.py', 'a.PYC'))
684682

685683
if os.name == 'nt':
@@ -695,6 +693,9 @@ def fnmatch(filename, pattern):
695693
self.assertFalse(fnmatch(r'a/b\c', r'a\b/c'))
696694
self.assertFalse(fnmatch(r'a/b/c', r'a\b\c'))
697695

696+
# as of 3.5, .pyo is no longer munged to .py
697+
self.assertFalse(fnmatch('a.pyo', 'a.py'))
698+
698699
def test_filter_match_trace(self):
699700
t1 = (("a.py", 2), ("b.py", 3))
700701
t2 = (("b.py", 4), ("b.py", 5))

0 commit comments

Comments
 (0)