summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/shutil.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 9ef1cf2ea6..dc36820dc9 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -58,9 +58,10 @@ def copyfile(src, dst):
except OSError:
# File most likely does not exist
pass
- # XXX What about other special files? (sockets, devices...)
- if stat.S_ISFIFO(st.st_mode):
- raise SpecialFileError("`%s` is a named pipe" % fn)
+ else:
+ # XXX What about other special files? (sockets, devices...)
+ if stat.S_ISFIFO(st.st_mode):
+ raise SpecialFileError("`%s` is a named pipe" % fn)
try:
fsrc = open(src, 'rb')
fdst = open(dst, 'wb')