From 6ee08fce6ec508fdc6e577e3e507b342d048fa16 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 27 Nov 2017 20:35:19 -0500 Subject: RF: primarily flake8 lints + minor RF to reduce duplication in PATHEXT I did keep some "bare" except with catch all Exception: , while tried to disable flake8 complaints where clearly all exceptions are to be catched --- git/diff.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'git/diff.py') diff --git a/git/diff.py b/git/diff.py index 16c782f3..28c10e49 100644 --- a/git/diff.py +++ b/git/diff.py @@ -313,20 +313,20 @@ class Diff(object): h %= self.b_blob.path msg = '' - l = None # temp line - ll = 0 # line length + line = None # temp line + line_length = 0 # line length for b, n in zip((self.a_blob, self.b_blob), ('lhs', 'rhs')): if b: - l = "\n%s: %o | %s" % (n, b.mode, b.hexsha) + line = "\n%s: %o | %s" % (n, b.mode, b.hexsha) else: - l = "\n%s: None" % n + line = "\n%s: None" % n # END if blob is not None - ll = max(len(l), ll) - msg += l + line_length = max(len(line), line_length) + msg += line # END for each blob # add headline - h += '\n' + '=' * ll + h += '\n' + '=' * line_length if self.deleted_file: msg += '\nfile deleted in rhs' -- cgit v1.2.1