From 54e2f32f5041b3813d2ef790826ce16cb8134c38 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Thu, 3 Feb 2022 19:30:11 +0100 Subject: [PATCH] test-network: use specific exceptions instead of the Exception class --- test/test-network/systemd-networkd-tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index edcfce9556..6be4b0eb76 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) -- 2.25.1