Patch from Corran Webster <cwebster@nevada.edu> (tweaked for style by me):
authorGreg Ward <gward@python.net>
Tue, 7 Mar 2000 03:34:16 +0000 (03:34 +0000)
committerGreg Ward <gward@python.net>
Tue, 7 Mar 2000 03:34:16 +0000 (03:34 +0000)
changed 'copy_file()' to use the native Mac file copy routine.

Lib/distutils/util.py

index 683d167641594ee7ba5c83caa61e9ae786382468..2f193fb43c5654148d3fafeff849fabe4cda84e0 100644 (file)
@@ -280,6 +280,17 @@ def copy_file (src, dst,
     if dry_run:
         return 1
 
+    # On a Mac, use the native file copy routine
+    if os.name == 'mac':
+        import macostools
+        try:
+            macostools.copy (src, dst, 0, preserve_times)
+        except OSError, exc:
+            raise DistutilsFileError, \
+                  "could not copy '%s' to '%s': %s" % (src, dst, exc[-1])
+        return 1
+    
+    # Otherwise use custom routine
     _copy_file_contents (src, dst)
     if preserve_mode or preserve_times:
         st = os.stat (src)