Index: Lib/shutil.py =================================================================== --- Lib/shutil.py (revision 61155) +++ Lib/shutil.py (working copy) @@ -201,13 +201,10 @@ os.rename(src, dst) except OSError: if os.path.isdir(src): - if destinsrc(src, dst): + if abspath(dst).startswith(abspath(src)): raise Error, "Cannot move a directory '%s' into itself '%s'." % (src, dst) copytree(src, dst, symlinks=True) rmtree(src) else: copy2(src,dst) - os.unlink(src) - -def destinsrc(src, dst): - return abspath(dst).startswith(abspath(src)) + os.unlink(src) \ No newline at end of file