mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Tweaked output of 'copy_file()': if copying to a new name, show the whole
destination path, otherwise show just the directory.
This commit is contained in:
parent
a4adafd55b
commit
4355093f94
1 changed files with 6 additions and 3 deletions
|
@ -90,7 +90,7 @@ def copy_file (src, dst,
|
||||||
(os.symlink) instead of copying: set it to "hard" or "sym"; if it
|
(os.symlink) instead of copying: set it to "hard" or "sym"; if it
|
||||||
is None (the default), files are copied. Don't set 'link' on
|
is None (the default), files are copied. Don't set 'link' on
|
||||||
systems that don't support it: 'copy_file()' doesn't check if
|
systems that don't support it: 'copy_file()' doesn't check if
|
||||||
hard or symbolic linking is availalble.
|
hard or symbolic linking is available.
|
||||||
|
|
||||||
Under Mac OS, uses the native file copy function in macostools;
|
Under Mac OS, uses the native file copy function in macostools;
|
||||||
on other systems, uses '_copy_file_contents()' to copy file
|
on other systems, uses '_copy_file_contents()' to copy file
|
||||||
|
@ -131,7 +131,10 @@ def copy_file (src, dst,
|
||||||
raise ValueError, \
|
raise ValueError, \
|
||||||
"invalid value '%s' for 'link' argument" % link
|
"invalid value '%s' for 'link' argument" % link
|
||||||
if verbose:
|
if verbose:
|
||||||
|
if os.path.basename(dst) == os.path.basename(src):
|
||||||
print "%s %s -> %s" % (action, src, dir)
|
print "%s %s -> %s" % (action, src, dir)
|
||||||
|
else:
|
||||||
|
print "%s %s -> %s" % (action, src, dst)
|
||||||
|
|
||||||
if dry_run:
|
if dry_run:
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue