summaryrefslogtreecommitdiff
path: root/Lib/distutils/file_util.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-06-23 01:42:40 +0000
committerGreg Ward <gward@python.net>2000-06-23 01:42:40 +0000
commit07f207a5e06ea008860314eb4f4c6f1f4e1a0057 (patch)
treef2087db0167ec9f5d6dbe50908b62c84c93ce264 /Lib/distutils/file_util.py
parent12b5cb88d27c6f5371b2796b10b464a72fee142f (diff)
downloadcpython-07f207a5e06ea008860314eb4f4c6f1f4e1a0057.tar.gz
Bastian Kleineidam: 'copy_file()' now returns the output filename, rather
than a boolean indicating whether it did the copy.
Diffstat (limited to 'Lib/distutils/file_util.py')
-rw-r--r--Lib/distutils/file_util.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/distutils/file_util.py b/Lib/distutils/file_util.py
index a73db42b54..2d0148f3f1 100644
--- a/Lib/distutils/file_util.py
+++ b/Lib/distutils/file_util.py
@@ -96,9 +96,8 @@ def copy_file (src, dst,
on other systems, uses '_copy_file_contents()' to copy file
contents.
- Return true if the file was copied (or would have been copied),
- false otherwise (ie. 'update' was true and the destination is
- up-to-date)."""
+ Return the name of the destination file, whether it was actually
+ copied or not."""
# XXX if the destination file already exists, we clobber it if
# copying, but blow up if linking. Hmmm. And I don't know what
@@ -123,7 +122,7 @@ def copy_file (src, dst,
if update and not newer (src, dst):
if verbose:
print "not copying %s (output up-to-date)" % src
- return 0
+ return dst
try:
action = _copy_action[link]
@@ -137,7 +136,7 @@ def copy_file (src, dst,
print "%s %s -> %s" % (action, src, dst)
if dry_run:
- return 1
+ return dst
# On a Mac, use the native file copy routine
if os.name == 'mac':
@@ -171,7 +170,7 @@ def copy_file (src, dst,
if preserve_mode:
os.chmod (dst, S_IMODE (st[ST_MODE]))
- return 1
+ return dst
# copy_file ()