diff options
author | John L. Villalovos <john@sodarock.com> | 2022-01-06 00:42:47 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-01-06 00:42:47 -0800 |
commit | 7555b3a663acdea99fab06baa23e48d335e7baec (patch) | |
tree | 25fe3834e8ae389cbcbd100d0817f7737ee3ad81 /gitlab/v4/objects/files.py | |
parent | a349793307e3a975bb51f864b48e5e9825f70182 (diff) | |
download | gitlab-jlvillal/put_post_raw.tar.gz |
chore: correct type-hints for http_put/http_postjlvillal/put_post_raw
http_put/http_post will either return a JSON object or nothing. We
never expect them to return a raw requests.response object.
Update type-hints and code to no longer have a requests.response
object as a possible return value.
Diffstat (limited to 'gitlab/v4/objects/files.py')
-rw-r--r-- | gitlab/v4/objects/files.py | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py index c3a8ec8..a40fc8c 100644 --- a/gitlab/v4/objects/files.py +++ b/gitlab/v4/objects/files.py @@ -147,8 +147,6 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa file_path = new_data.pop("file_path").replace("/", "%2F") path = f"{self.path}/{file_path}" server_data = self.gitlab.http_post(path, post_data=new_data, **kwargs) - if TYPE_CHECKING: - assert isinstance(server_data, dict) return self._obj_cls(self, server_data) @exc.on_http_error(exc.GitlabUpdateError) @@ -178,8 +176,6 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa path = f"{self.path}/{file_path}" self._check_missing_update_attrs(data) result = self.gitlab.http_put(path, post_data=data, **kwargs) - if TYPE_CHECKING: - assert isinstance(result, dict) return result @cli.register_custom_action( |