diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-05 19:09:28 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-05 19:09:28 +0000 |
commit | a663a373b2f866d77155f67de8c054b352890238 (patch) | |
tree | cd81f6672f3175e6af67afdb859540e539afba60 | |
parent | d53d085ada3f33aeb0d45a69c323b8930583c7b4 (diff) | |
download | cpython-git-a663a373b2f866d77155f67de8c054b352890238.tar.gz |
only test for named pipe when os.stat doesn't raise #6209
-rw-r--r-- | Lib/shutil.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index c46ec47fd3..a689256f15 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') |