Fixed #21122 -- Improved clean up of test temp directory on Windows

- Fixed test that didn't close the files it opened
- Caught and handled exception when temp directory cannot be removed
This commit is contained in:
Kevin Christopher Henry 2013-09-19 17:02:49 -04:00 committed by Tim Graham
parent 5381317fe3
commit 978e1351a6
2 changed files with 20 additions and 7 deletions

View file

@ -174,3 +174,6 @@ class FileMoveSafeTests(unittest.TestCase):
# should allow it and continue on if allow_overwrite is True
self.assertIsNone(file_move_safe(self.file_a, self.file_b, allow_overwrite=True))
os.close(handle_a)
os.close(handle_b)