From: Greg Ward Date: Tue, 7 Mar 2000 03:34:16 +0000 (+0000) Subject: Patch from Corran Webster (tweaked for style by me): X-Git-Tag: v1.6a1~270 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=911d86693b8224c6bd2de2f3de83d9c521574a1b;p=python Patch from Corran Webster (tweaked for style by me): changed 'copy_file()' to use the native Mac file copy routine. --- diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 683d167641..2f193fb43c 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)