]> granicus.if.org Git - python/commitdiff
Merged revisions 73250 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Fri, 5 Jun 2009 19:13:27 +0000 (19:13 +0000)
committerBenjamin Peterson <benjamin@python.org>
Fri, 5 Jun 2009 19:13:27 +0000 (19:13 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73250 | benjamin.peterson | 2009-06-05 14:09:28 -0500 (Fri, 05 Jun 2009) | 1 line

  only test for named pipe when os.stat doesn't raise #6209
........

Lib/shutil.py

index 9ef1cf2ea61e0eb847b870abfb5c7b27a2d70736..dc36820dc9a77c893bf4c58ce0d81cabb9a88eb0 100644 (file)
@@ -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')