From 745007bd12e519089a777e0b6dbd9c5f456449c5 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 19 Jun 2016 14:39:45 +0200 Subject: [PATCH 1/2] flake8: ignore F405, fixes #1185 We know that star imports have their issues and we only have one of them, for good reasons. Thus, we switch off that new F405 test/message. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 812f6bee3..6f408a95f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ python_files = testsuite/*.py # please note that the values are adjusted so that they do not cause failures # with existing code. if you want to change them, you should first fix all # flake8 failures that appear with your change. -ignore = E122,E123,E125,E126,E127,E128,E226,E402,F401,F811 +ignore = E122,E123,E125,E126,E127,E128,E226,E402,F401,F405,F811 # line length long term target: 120 max-line-length = 255 exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py From 278cf0b9adc0b71b6f538fbfdbdb44d008610d4e Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 19 Jun 2016 14:55:57 +0200 Subject: [PATCH 2/2] helpers: fix "undefined name 'e'" in exception handler --- borg/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/borg/helpers.py b/borg/helpers.py index e9b8d9a3a..fad401a52 100644 --- a/borg/helpers.py +++ b/borg/helpers.py @@ -559,7 +559,7 @@ def format_line(format, data): except (KeyError, ValueError) as e: # this should catch format errors print('Error in lineformat: "{}" - reason "{}"'.format(format, str(e))) - except: + except Exception as e: # something unexpected, print error and raise exception print('Error in lineformat: "{}" - reason "{}"'.format(format, str(e))) raise