summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-03-07 03:34:16 (GMT)
committerGreg Ward <gward@python.net>2000-03-07 03:34:16 (GMT)
commit911d86693b8224c6bd2de2f3de83d9c521574a1b (patch)
tree568583695e1a3c5b759ad1f9191b29a534225f70 /Lib/distutils
parent0eff87a570fb6395b50ef815792f30de076203aa (diff)
downloadcpython-911d86693b8224c6bd2de2f3de83d9c521574a1b.zip
cpython-911d86693b8224c6bd2de2f3de83d9c521574a1b.tar.gz
cpython-911d86693b8224c6bd2de2f3de83d9c521574a1b.tar.bz2
Patch from Corran Webster <cwebster@nevada.edu> (tweaked for style by me):
changed 'copy_file()' to use the native Mac file copy routine.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/util.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index 683d167..2f193fb 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -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)