]> Savannah Git Hosting - gnulib.git/commitdiff
vfs: eliminate weird pylint warning
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 5 Dec 2017 18:13:16 +0000 (21:13 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Mon, 11 Dec 2017 21:58:08 +0000 (00:58 +0300)
pygnulib/vfs.py

index 8403257fcf7513010914fddaac08208ce1e0bbf4..57e47b780c476253f6c85ef1b62ec6e98497d6e8 100644 (file)
@@ -137,13 +137,13 @@ def mkdir(root, name):
 def backup(root, name):
     """Backup the given file."""
     root = Base(".") if root is None else root
-    path = _os.path.join(root.absolute, root[name])
-    backup = "{}~".format(path)
+    original_path = _os.path.join(root.absolute, root[name])
+    backup_path = "{}~".format(original_path)
     try:
-        _os.unlink(backup)
+        _os.unlink(backup_path)
     except FileNotFoundError:
         pass # ignore non-existent files
-    _os.rename(path, backup)
+    _os.rename(original_path, backup_path)
 
 
 def compare(lhs_root, lhs_name, rhs_root, rhs_name):