mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
only test for named pipe when os.stat doesn't raise #6209
This commit is contained in:
parent
d53d085ada
commit
a663a373b2
1 changed files with 4 additions and 3 deletions
|
@ -58,9 +58,10 @@ def copyfile(src, dst):
|
||||||
except OSError:
|
except OSError:
|
||||||
# File most likely does not exist
|
# File most likely does not exist
|
||||||
pass
|
pass
|
||||||
# XXX What about other special files? (sockets, devices...)
|
else:
|
||||||
if stat.S_ISFIFO(st.st_mode):
|
# XXX What about other special files? (sockets, devices...)
|
||||||
raise SpecialFileError("`%s` is a named pipe" % fn)
|
if stat.S_ISFIFO(st.st_mode):
|
||||||
|
raise SpecialFileError("`%s` is a named pipe" % fn)
|
||||||
try:
|
try:
|
||||||
fsrc = open(src, 'rb')
|
fsrc = open(src, 'rb')
|
||||||
fdst = open(dst, 'wb')
|
fdst = open(dst, 'wb')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue