Commit 4a2ccdf7 authored by Guido van Rossum's avatar Guido van Rossum

- 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???]
parent 80e1f065
......@@ -128,6 +128,7 @@ def rmtree(path, ignore_errors=False, onerror=None):
cmdtuples = []
arg = path
try:
func = os.listdir # Make sure it isn't unset
_build_cmdtuple(path, cmdtuples)
for func, arg in cmdtuples:
func(arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment