First, can you please follow good practice and use a short (<= 80,
preferably 72) characters for the first line of your commits and then
put the longer version? This makes things look a lot better in gitweb,
git log, git shortlog, etc....
Also, shutil.move already does this so it really shouldn't be needed
here as well
def move(src, dst):
"""Recursively move a file or directory to another location.
If the destination is on our current filesystem, then simply use
rename. Otherwise, copy src to the dst and then remove src.
A lot more could be done here... A look at a mv.c shows a lot of
the issues this implementation glosses over.
"""
try:
os.rename(src, dst)
except OSError:
if os.path.isdir(src):
if destinsrc(src, dst):
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)
Jeremy