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/exc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/exc.py') diff --git a/git/exc.py b/git/exc.py index a737110c..5c5aa2b4 100644 --- a/git/exc.py +++ b/git/exc.py @@ -48,7 +48,7 @@ class CommandError(UnicodeMixin, GitError): else: try: status = u'exit code(%s)' % int(status) - except: + except ValueError: s = safe_decode(str(status)) status = u"'%s'" % s if isinstance(status, string_types) else s -- cgit v1.2.1 From e1aea3af6dcabfe4c6414578b22bfbb31a7e1840 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 27 Nov 2017 22:25:57 -0500 Subject: BF: crazy tests ppl pass an object for status... uff -- catch TypeError too --- git/exc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git/exc.py') diff --git a/git/exc.py b/git/exc.py index 5c5aa2b4..4865da94 100644 --- a/git/exc.py +++ b/git/exc.py @@ -48,7 +48,7 @@ class CommandError(UnicodeMixin, GitError): else: try: status = u'exit code(%s)' % int(status) - except ValueError: + except (ValueError, TypeError): s = safe_decode(str(status)) status = u"'%s'" % s if isinstance(status, string_types) else s -- cgit v1.2.1