Skip to content

Commit dd00bfc

Browse files
JohnVillalovosnejch
authored andcommitted
chore: update mypy to 1.9.0 and resolve one issue
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.
1 parent f6e8692 commit dd00bfc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
- requests-toolbelt==1.0.0
3131
files: 'gitlab/'
3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v1.8.0
33+
rev: v1.9.0
3434
hooks:
3535
- id: mypy
3636
args: []

gitlab/utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def __call__(self, chunk: Any) -> None:
1818

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

2324
return message.get_content_type()
2425

requirements-lint.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ black==24.3.0
44
commitizen==3.16.0
55
flake8==7.0.0
66
isort==5.13.2
7-
mypy==1.8.0
7+
mypy==1.9.0
88
pylint==3.1.0
99
pytest==8.0.2
1010
responses==0.25.0

0 commit comments

Comments
 (0)