From: Lukáš Ježek Date: Wed, 16 Sep 2020 11:09:43 +0000 (+0200) Subject: ci: pylint: fix raise-missing-from warning (W0707) X-Git-Tag: v5.2.0~34^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c96fc4a883936214a4207020030fc54a62f84da;p=thirdparty%2Fknot-resolver.git ci: pylint: fix raise-missing-from warning (W0707) --- diff --git a/tests/pytests/kresd.py b/tests/pytests/kresd.py index 75776f2ea..f190003db 100644 --- a/tests/pytests/kresd.py +++ b/tests/pytests/kresd.py @@ -263,9 +263,9 @@ def take_port(port, ip=None, ip6=None, timeout=0): end_time = time.time() + timeout try: port_path.touch(exist_ok=False) - except FileExistsError: + except FileExistsError as ex: raise ValueError( - "Port {} already reserved by system or another kresd instance!".format(port)) + "Port {} already reserved by system or another kresd instance!".format(port)) from ex while True: if is_port_free(port, ip, ip6): diff --git a/tests/pytests/utils.py b/tests/pytests/utils.py index 2953f2a61..812b6f3ce 100644 --- a/tests/pytests/utils.py +++ b/tests/pytests/utils.py @@ -103,9 +103,9 @@ def expect_kresd_close(rst_ok=False): try: time.sleep(0.2) # give kresd time to close connection with TCP FIN yield - except ConnectionResetError: + except ConnectionResetError as ex: if rst_ok: - raise BrokenPipeError + raise BrokenPipeError from ex pytest.skip("kresd closed connection with TCP RST") pytest.fail("kresd didn't close the connection")