From a663a373b2f866d77155f67de8c054b352890238 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Fri, 5 Jun 2009 19:09:28 +0000 Subject: only test for named pipe when os.stat doesn't raise #6209 --- Lib/shutil.py | 7 ++++--- 1 file 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') -- cgit v0.12