Improve type hints. (#913)

This commit is contained in:
Felix Fontein
2025-06-01 21:33:20 +02:00
committed by GitHub
parent 576a06b5b2
commit f68b0d0c08
13 changed files with 95 additions and 22 deletions

View File

@@ -45,7 +45,8 @@ def restore_on_failure(
if backup_file is not None:
module.atomic_move(os.path.abspath(backup_file), os.path.abspath(path))
raise
module.add_cleanup_file(backup_file)
if backup_file is not None:
module.add_cleanup_file(backup_file)
return backup_and_restore