mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-22 12:28:05 +00:00
fileutil: make the error behaviour of replace_file on Unix more similar to Windows.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
3cffe2599e
commit
a2cb04fe7d
@ -615,6 +615,8 @@ else:
|
||||
precondition_abspath(replacement_path)
|
||||
precondition_abspath(backup_path)
|
||||
|
||||
if not os.path.exists(replacement_path):
|
||||
raise ConflictError("Replacement file not found: %r" % (replacement_path,))
|
||||
try:
|
||||
os.rename(replaced_path, backup_path)
|
||||
rename_no_overwrite(replacement_path, replaced_path)
|
||||
|
Loading…
Reference in New Issue
Block a user