Commit f9a098ef authored by Johannes Gijsbers's avatar Johannes Gijsbers

Catch OSError raised when src or dst argument to os.path.samefile doesn't

exist.
parent b112d6ed
......@@ -27,7 +27,10 @@ def copyfileobj(fsrc, fdst, length=16*1024):
def _samefile(src, dst):
# Macintosh, Unix.
if hasattr(os.path,'samefile'):
return os.path.samefile(src, dst)
try:
return os.path.samefile(src, dst)
except OSError:
return False
# All other platforms: check for same pathname.
return (os.path.normcase(os.path.abspath(src)) ==
......
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