From 36ad9855d1a6f252a62b4723e4c04ddf537c387c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 26 Aug 2022 00:00:01 +0200 Subject: [PATCH] tests: fix "test-client.py" for early python3 versions ModuleNotFoundError was only introduced in later python 3 versions. Use just "ImportError", which is the parent class anyway. Fixes: f7e484c8eda4 ('tests: fix "test-client.py" ignoring missing "NM" module') (cherry picked from commit 9902373c6d984f3a72a6dc5f0b6ea1cf3a09f18d) --- src/tests/client/test-client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py index 68cc08e86..85a09ad25 100755 --- a/src/tests/client/test-client.py +++ b/src/tests/client/test-client.py @@ -111,8 +111,6 @@ import dbus.service import dbus.mainloop.glib import io -moduleNotFoundError = ModuleNotFoundError if sys.version_info[0] >= 3 else ImportError - import gi try: @@ -132,7 +130,7 @@ else: try: import pexpect -except moduleNotFoundError: +except ImportError: pexpect = None