Fix use of wrong 'i' variable name
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 25 Jan 2020 17:48:29 +0000 (18:48 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 27 Jan 2020 17:23:24 +0000 (18:23 +0100)
pylint complained:
tarfile.py:3797:38: E0602: Undefined variable 'i' (undefined-variable)

Code was introduced like this in

commit 27ee4dd4df48340541317123f5df348056c235ca
Author:     Philipp Gesang <philipp.gesang@intra2net.com>
AuthorDate: Tue Aug 29 12:00:54 2017 +0200

    implement volume handling for rescue mode

    When reconstructing the index, traverse backup volumes and set
    the “volume” member on the objects appropriately.

-> I guess 'i' was renamed to nvol for better readability.

deltatar/tarfile.py

index 06f4524..fa771aa 100644 (file)
@@ -3794,7 +3794,7 @@ def gen_rescue_index (gen_volume_name, mode, maxvol=None, password=None, key=Non
                 raise TarError ("no rescue handling for mode “%s”" % mode)
         except FileNotFoundError as exn:
             # volume does not exist
-            if maxvol is not None and i < maxvol:
+            if maxvol is not None and nvol < maxvol:
                 continue # explicit volume number specified, ignore missing ones
             else:
                 break