From 69ca329f6015301e289fcbb3c021e430c1bdfa81 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 28 May 2020 21:40:27 +0800 Subject: Fix flake8 errors --- git/index/base.py | 4 ++-- git/refs/symbolic.py | 2 +- git/remote.py | 2 +- git/test/test_index.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/git/index/base.py b/git/index/base.py index 2569e3d7..46974239 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -463,8 +463,8 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): for stage, blob in self.iter_blobs(is_unmerged_blob): path_map.setdefault(blob.path, []).append((stage, blob)) # END for each unmerged blob - for l in path_map.values(): - l.sort() + for line in path_map.values(): + line.sort() return path_map @classmethod diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index aa449528..ee006cbc 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -466,7 +466,7 @@ class SymbolicReference(object): # write-binary is required, otherwise windows will # open the file in text mode and change LF to CRLF ! with open(pack_file_path, 'wb') as fd: - fd.writelines(l.encode(defenc) for l in new_lines) + fd.writelines(line.encode(defenc) for line in new_lines) except (OSError, IOError): pass # it didn't exist at all diff --git a/git/remote.py b/git/remote.py index 17fe6c2f..8b00ba0a 100644 --- a/git/remote.py +++ b/git/remote.py @@ -686,7 +686,7 @@ class Remote(LazyMixin, Iterable): # read head information with open(osp.join(self.repo.common_dir, 'FETCH_HEAD'), 'rb') as fp: - fetch_head_info = [l.decode(defenc) for l in fp.readlines()] + fetch_head_info = [line.decode(defenc) for line in fp.readlines()] l_fil = len(fetch_info_lines) l_fhi = len(fetch_head_info) diff --git a/git/test/test_index.py b/git/test/test_index.py index 3575348a..ce14537a 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -212,7 +212,7 @@ class TestIndex(TestBase): assert unmerged_blob_map # pick the first blob at the first stage we find and use it as resolved version - three_way_index.resolve_blobs(l[0][1] for l in unmerged_blob_map.values()) + three_way_index.resolve_blobs(line[0][1] for line in unmerged_blob_map.values()) tree = three_way_index.write_tree() assert isinstance(tree, Tree) num_blobs = 0 -- cgit v1.2.1