diff options
author | John L. Villalovos <john@sodarock.com> | 2022-06-03 10:40:01 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-06-04 09:18:22 -0700 |
commit | 1a2781e477471626e2b00129bef5169be9c7cc06 (patch) | |
tree | e13256bb9f0109a2af72697fcd4184eeb03da626 /gitlab | |
parent | 50fdbc474c524188952e0ef7c02b0bd92df82357 (diff) | |
download | gitlab-1a2781e477471626e2b00129bef5169be9c7cc06.tar.gz |
chore: enable pylint check "raise-missing-from"
Enable the pylint check "raise-missing-from" and fix errors detected.
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/config.py | 6 | ||||
-rw-r--r-- | gitlab/v4/objects/packages.py | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/gitlab/config.py b/gitlab/config.py index 337a265..2e98b59 100644 --- a/gitlab/config.py +++ b/gitlab/config.py @@ -56,7 +56,9 @@ def _get_config_files( try: resolved = _resolve_file(config_file) except OSError as e: - raise GitlabConfigMissingError(f"Cannot read config from file: {e}") + raise GitlabConfigMissingError( + f"Cannot read config from file: {e}" + ) from e resolved_files.append(resolved) return resolved_files @@ -69,7 +71,7 @@ def _get_config_files( except OSError as e: raise GitlabConfigMissingError( f"Cannot read config from PYTHON_GITLAB_CFG: {e}" - ) + ) from e for config_file in _DEFAULT_FILES: try: diff --git a/gitlab/v4/objects/packages.py b/gitlab/v4/objects/packages.py index 0461bdc..882cb1a 100644 --- a/gitlab/v4/objects/packages.py +++ b/gitlab/v4/objects/packages.py @@ -73,8 +73,8 @@ class GenericPackageManager(RESTManager): try: with open(path, "rb") as f: file_data = f.read() - except OSError: - raise exc.GitlabUploadError(f"Failed to read package file {path}") + except OSError as e: + raise exc.GitlabUploadError(f"Failed to read package file {path}") from e url = f"{self._computed_path}/{package_name}/{package_version}/{file_name}" server_data = self.gitlab.http_put(url, post_data=file_data, raw=True, **kwargs) |