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/remote.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'git/remote.py') diff --git a/git/remote.py b/git/remote.py index 35460f5a..813566a2 100644 --- a/git/remote.py +++ b/git/remote.py @@ -542,9 +542,11 @@ class Remote(LazyMixin, Iterable): if ' Push URL:' in line: yield line.split(': ')[-1] except GitCommandError as ex: - if any([msg in str(ex) for msg in ['correct access rights','cannot run ssh']]): - # If ssh is not setup to access this repository, see issue 694 - result = Git().execute(['git','config','--get','remote.%s.url' % self.name]) + if any([msg in str(ex) for msg in ['correct access rights', 'cannot run ssh']]): + # If ssh is not setup to access this repository, see issue 694 + result = Git().execute( + ['git', 'config', '--get', 'remote.%s.url' % self.name] + ) yield result else: raise ex -- cgit v1.2.1