]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #15478: Fix test_pep277 on Windows
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Nov 2012 00:28:28 +0000 (01:28 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Nov 2012 00:28:28 +0000 (01:28 +0100)
os.listdir() now returns the original path in OSError.filename (on any
platform), even if "*.*" was added to the path (on Windows).

Lib/test/test_pep277.py

index 4b16cbb383d217da6e756b0ca46b402b51f0fd9d..9bae6dcad7a3bd8d0087f1e249ebdc2cda68bbff 100644 (file)
@@ -99,10 +99,6 @@ class UnicodeFileTests(unittest.TestCase):
         with self.assertRaises(expected_exception) as c:
             fn(filename)
         exc_filename = c.exception.filename
-        # listdir may append a wildcard to the filename
-        if fn is os.listdir and sys.platform == 'win32':
-            exc_filename, _, wildcard = exc_filename.rpartition(os.sep)
-            self.assertEqual(wildcard, '*.*')
         if check_filename:
             self.assertEqual(exc_filename, filename, "Function '%s(%a) failed "
                              "with bad filename in the exception: %a" %