From: Benjamin Peterson Date: Fri, 5 Jun 2009 19:09:28 +0000 (+0000) Subject: only test for named pipe when os.stat doesn't raise #6209 X-Git-Tag: v2.7a1~1020 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a663a373b2f866d77155f67de8c054b352890238;p=thirdparty%2FPython%2Fcpython.git only test for named pipe when os.stat doesn't raise #6209 --- diff --git a/Lib/shutil.py b/Lib/shutil.py index c46ec47fd3b3..a689256f15dc 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')