From: Frantisek Sumsal Date: Thu, 3 Feb 2022 18:30:11 +0000 (+0100) Subject: test-network: use specific exceptions instead of the Exception class X-Git-Tag: v251-rc1~356^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54e2f32f5041b3813d2ef790826ce16cb8134c38;p=thirdparty%2Fsystemd.git test-network: use specific exceptions instead of the Exception class --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index edcfce9556b..6be4b0eb76c 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -198,7 +198,7 @@ def expectedFailureIfNetdevsimWithSRIOVIsNotAvailable(): try: with open('/sys/bus/netdevsim/new_device', mode='w') as f: f.write('99 1') - except Exception: + except OSError: return unittest.expectedFailure(func) call('udevadm settle') @@ -206,7 +206,7 @@ def expectedFailureIfNetdevsimWithSRIOVIsNotAvailable(): try: with open('/sys/class/net/eni99np1/device/sriov_numvfs', mode='w') as f: f.write('3') - except Exception: + except OSError: call('rmmod netdevsim', stderr=subprocess.DEVNULL) return unittest.expectedFailure(func)