]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: use specific exceptions instead of the Exception class
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 3 Feb 2022 18:30:11 +0000 (19:30 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 3 Feb 2022 18:30:11 +0000 (19:30 +0100)
test/test-network/systemd-networkd-tests.py

index edcfce9556bf855d98cae4a340630eb4778c567b..6be4b0eb76c6613a31ce7793986b6ad17c47e38e 100755 (executable)
@@ -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)