Skip to content

Commit

Permalink
chore: update mypy to 1.9.0 and resolve one issue
Browse files Browse the repository at this point in the history
mypy 1.9.0 flagged one issue in the code. Resolve the issue. Current
unit tests already check that a `None` value returns `text/plain`. So
function is still working as expected.
  • Loading branch information
JohnVillalovos authored and nejch committed Mar 27, 2024
1 parent f6e8692 commit dd00bfc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- requests-toolbelt==1.0.0
files: 'gitlab/'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
args: []
Expand Down
3 changes: 2 additions & 1 deletion gitlab/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def __call__(self, chunk: Any) -> None:

def get_content_type(content_type: Optional[str]) -> str:
message = email.message.Message()
message["content-type"] = content_type
if content_type is not None:
message["content-type"] = content_type

return message.get_content_type()

Expand Down
2 changes: 1 addition & 1 deletion requirements-lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ black==24.3.0
commitizen==3.16.0
flake8==7.0.0
isort==5.13.2
mypy==1.8.0
mypy==1.9.0
pylint==3.1.0
pytest==8.0.2
responses==0.25.0
Expand Down

0 comments on commit dd00bfc

Please sign in to comment.