summaryrefslogtreecommitdiff
path: root/gitlab/client.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-05-29 17:12:40 -0700
committerJohn L. Villalovos <john@sodarock.com>2022-05-29 17:12:40 -0700
commit0b7933c5632c2f81c89f9a97e814badf65d1eb38 (patch)
tree087c06c87f2dadef60447a249ee66d41daed5b87 /gitlab/client.py
parentf0152dc3cc9a42aa4dc3c0014b4c29381e9b39d6 (diff)
downloadgitlab-0b7933c5632c2f81c89f9a97e814badf65d1eb38.tar.gz
chore: correct ModuleNotFoundError() arguments
Previously in commit 233b79ed442aac66faf9eb4b0087ea126d6dffc5 I had used the `name` argument for `ModuleNotFoundError()`. This basically is the equivalent of not passing any message to `ModuleNotFoundError()`. So when the exception was raised it wasn't very helpful. Correct that and add a unit-test that shows we get the message we expect.
Diffstat (limited to 'gitlab/client.py')
-rw-r--r--gitlab/client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/client.py b/gitlab/client.py
index bba5c1d..a9bd48f 100644
--- a/gitlab/client.py
+++ b/gitlab/client.py
@@ -116,7 +116,7 @@ class Gitlab:
# We only support v4 API at this time
if self._api_version not in ("4",):
- raise ModuleNotFoundError(name=f"gitlab.v{self._api_version}.objects")
+ raise ModuleNotFoundError(f"gitlab.v{self._api_version}.objects")
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors
import gitlab.v4.objects
@@ -209,7 +209,7 @@ class Gitlab:
# We only support v4 API at this time
if self._api_version not in ("4",):
raise ModuleNotFoundError(
- name=f"gitlab.v{self._api_version}.objects"
+ f"gitlab.v{self._api_version}.objects"
) # pragma: no cover, dead code currently
# NOTE: We must delay import of gitlab.v4.objects until now or
# otherwise it will cause circular import errors