mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-28564: Use os.scandir() in shutil.rmtree(). (#4085)
This speeds up it to 20-40%.
This commit is contained in:
parent
82cd3cede8
commit
d4d79bc1ff
4 changed files with 55 additions and 31 deletions
|
@ -183,7 +183,7 @@ class TestShutil(unittest.TestCase):
|
|||
errors.append(args)
|
||||
shutil.rmtree(filename, onerror=onerror)
|
||||
self.assertEqual(len(errors), 2)
|
||||
self.assertIs(errors[0][0], os.listdir)
|
||||
self.assertIs(errors[0][0], os.scandir)
|
||||
self.assertEqual(errors[0][1], filename)
|
||||
self.assertIsInstance(errors[0][2][1], NotADirectoryError)
|
||||
self.assertIn(errors[0][2][1].filename, possible_args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue