Skip to content

Commit 812805c

Browse files
committed
fix mypy
1 parent 6e90838 commit 812805c

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

pigwig/pigwig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import urllib.parse
1111
import wsgiref.simple_server
1212
from inspect import isgenerator
13-
from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, MutableMapping, TextIO
13+
from typing import TYPE_CHECKING, Any, Callable, Iterable, Mapping, MutableMapping, TextIO, cast
1414

1515
from . import exceptions, multipart
1616
from .request_response import HTTPHeaders, Request, Response
@@ -114,7 +114,7 @@ def __init__(self, routes: RouteDefinition | Callable[[], RouteDefinition], temp
114114

115115
def __call__(self, environ: dict, start_response: Callable) -> Iterable[bytes]:
116116
""" main WSGI entrypoint """
117-
errors = environ.get('wsgi.errors', sys.stderr)
117+
errors = cast(TextIO, environ.get('wsgi.errors', sys.stderr))
118118
try:
119119
if environ['REQUEST_METHOD'] == 'OPTIONS':
120120
start_response('200 OK', copy.copy(Response.DEFAULT_HEADERS))

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ include = ['pigwig']
2020
exclude = ['pigwig.tests']
2121
[dependency-groups]
2222
dev = [
23+
'mypy',
2324
'ruff',
2425
]
2526

2627
[tool.mypy]
27-
python_version = '3.8'
28+
python_version = '3.9'
2829
exclude = ['setup.py', 'docs/conf.py']
2930
disallow_untyped_defs = true
3031
implicit_reexport = false

0 commit comments

Comments
 (0)