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: f7e484c8ed ('tests: fix "test-client.py" ignoring missing "NM" module')
(cherry picked from commit 9902373c6d)
This commit is contained in:
Thomas Haller
2022-08-26 00:00:01 +02:00
parent d6d76f900f
commit 36ad9855d1

View File

@@ -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