diff -r 23459df0753e Lib/test/support/__init__.py --- a/Lib/test/support/__init__.py Wed Nov 27 02:26:54 2013 -0800 +++ b/Lib/test/support/__init__.py Wed Nov 27 11:52:17 2013 -0700 @@ -26,6 +26,7 @@ import struct import tempfile import _testcapi +import stat try: import _thread, threading @@ -317,7 +318,11 @@ def _rmtree_inner(path): for name in os.listdir(path): fullname = os.path.join(path, name) - if os.path.isdir(fullname): + try: + mode = os.lstat(fullname).st_mode + except OSError: + mode = 0 + if stat.S_ISDIR(mode): _waitfor(_rmtree_inner, fullname, waitall=True) os.rmdir(fullname) else: