Issue #15478: Fix test_pep277 on Windows

os.listdir() now returns the original path in OSError.filename (on any
platform), even if "*.*" was added to the path (on Windows).
This commit is contained in:
Victor Stinner 2012-11-05 01:28:28 +01:00
parent 4e7d2d481a
commit efe2b53d12
1 changed files with 0 additions and 4 deletions

View 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" %