summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2004-07-14 00:45:59 (GMT)
committerGuido van Rossum <guido@python.org>2004-07-14 00:45:59 (GMT)
commit4a2ccdf781b1648f34f303ee3d411d63c306e17e (patch)
tree21131d37667d86fad60db89e1e3582c239ebd112
parent80e1f06594c376a996ae7eb9c7ae26e18fb3d4c5 (diff)
downloadcpython-4a2ccdf781b1648f34f303ee3d411d63c306e17e.zip
cpython-4a2ccdf781b1648f34f303ee3d411d63c306e17e.tar.gz
cpython-4a2ccdf781b1648f34f303ee3d411d63c306e17e.tar.bz2
- 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???]
-rw-r--r--Lib/shutil.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 10b7a27..fde8c90 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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)