only test for named pipe when os.stat doesn't raise #6209

This commit is contained in:
Benjamin Peterson 2009-06-05 19:09:28 +00:00
parent d53d085ada
commit a663a373b2

View file

@ -58,6 +58,7 @@ def copyfile(src, dst):
except OSError: except OSError:
# File most likely does not exist # File most likely does not exist
pass pass
else:
# XXX What about other special files? (sockets, devices...) # XXX What about other special files? (sockets, devices...)
if stat.S_ISFIFO(st.st_mode): if stat.S_ISFIFO(st.st_mode):
raise SpecialFileError("`%s` is a named pipe" % fn) raise SpecialFileError("`%s` is a named pipe" % fn)