From: Dmitry Selyutin Date: Tue, 5 Dec 2017 18:13:16 +0000 (+0300) Subject: vfs: eliminate weird pylint warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a4c6e77dee4132b2c46306c5e8dd851611be66b;p=thirdparty%2Fgnulib.git vfs: eliminate weird pylint warning --- diff --git a/pygnulib/vfs.py b/pygnulib/vfs.py index 8403257fcf..57e47b780c 100644 --- a/pygnulib/vfs.py +++ b/pygnulib/vfs.py @@ -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):