summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJohannes Gijsbers <jlg@dds.nl>2004-08-14 14:51:01 (GMT)
committerJohannes Gijsbers <jlg@dds.nl>2004-08-14 14:51:01 (GMT)
commitf9a098efe1dcfba59d8bf2026892ee65454c29b6 (patch)
tree8cc31469770180562ac4361a7cafa448887e7620 /Lib
parentb112d6ed78327404d5cb5d3f4ee6ffb7db70d695 (diff)
downloadcpython-f9a098efe1dcfba59d8bf2026892ee65454c29b6.zip
cpython-f9a098efe1dcfba59d8bf2026892ee65454c29b6.tar.gz
cpython-f9a098efe1dcfba59d8bf2026892ee65454c29b6.tar.bz2
Catch OSError raised when src or dst argument to os.path.samefile doesn't
exist.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/shutil.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index d361fa2..43726b4 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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)) ==