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 | |
| 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.
| -rw-r--r-- | gitlab/config.py | 6 | ||||
| -rw-r--r-- | gitlab/v4/objects/packages.py | 4 | ||||
| -rw-r--r-- | pyproject.toml | 1 |
3 files changed, 6 insertions, 5 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) diff --git a/pyproject.toml b/pyproject.toml index f521546..f2e9f09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,6 @@ disable = [ "no-else-return", "no-self-use", "protected-access", - "raise-missing-from", "redefined-builtin", "redefined-outer-name", "signature-differs", |
