diff options
| author | Benjamin Peterson <benjamin@python.org> | 2009-06-05 19:09:28 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2009-06-05 19:09:28 (GMT) |
| commit | a663a373b2f866d77155f67de8c054b352890238 (patch) | |
| tree | cd81f6672f3175e6af67afdb859540e539afba60 /Lib/shutil.py | |
| parent | d53d085ada3f33aeb0d45a69c323b8930583c7b4 (diff) | |
| download | cpython-a663a373b2f866d77155f67de8c054b352890238.zip cpython-a663a373b2f866d77155f67de8c054b352890238.tar.gz cpython-a663a373b2f866d77155f67de8c054b352890238.tar.bz2 | |
only test for named pipe when os.stat doesn't raise #6209
Diffstat (limited to 'Lib/shutil.py')
| -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 c46ec47..a689256 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') |
