- Bug #981530: Fix UnboundLocalError in shutil.rmtree(). This affects

the documented behavior: the function passed to the onerror()
  handler can now also be os.listdir.

[I could've sworn I checked this in, but apparently I didn't, or it
got lost???]
This commit is contained in:
Guido van Rossum 2004-07-14 00:48:58 +00:00
parent 4a2ccdf781
commit 8cec3ab0e4
2 changed files with 2 additions and 1 deletions

View file

@ -13,6 +13,7 @@ class TestShutil(unittest.TestCase):
filename = tempfile.mktemp()
self.assertRaises(OSError, shutil.rmtree, filename)
self.assertEqual(shutil.rmtree(filename, True), None)
shutil.rmtree(filename, False, lambda func, arg, exc: None)
def test_dont_move_dir_in_itself(self):
src_dir = tempfile.mkdtemp()