Skip to content

Commit d7d0294

Browse files
committed
Fix mypy
1 parent 57be463 commit d7d0294

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

flask_openapi3/request.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
from typing import Any, Type, Optional, Dict, get_origin, get_args, Union
88

99
try:
10-
from types import UnionType # Python 3.10+
10+
from types import UnionType # type: ignore
1111
except ImportError:
12-
UnionType = type(Union)
12+
# python < 3.9
13+
UnionType = type(Union) # type: ignore
1314

1415
from flask import request, current_app, abort
1516
from pydantic import ValidationError, BaseModel, RootModel

flask_openapi3/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
from typing import get_type_hints, Dict, Type, Callable, List, Tuple, Optional, Any, DefaultDict, Union
1212

1313
try:
14-
from types import UnionType # Python 3.10+
14+
from types import UnionType # type: ignore
1515
except ImportError:
16-
UnionType = type(Union)
16+
# python < 3.9
17+
UnionType = type(Union) # type: ignore
1718

1819
from flask import make_response, current_app
1920
from flask.wrappers import Response as FlaskResponse

0 commit comments

Comments
 (0)