Skip to content

Commit 8bcb3fd

Browse files
author
Michal Ploski
committed
Fix typing errors for python 3.6
1 parent 0c55c97 commit 8bcb3fd

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

aws_lambda_powertools/event_handler/api_gateway.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from enum import Enum
1111
from functools import partial
1212
from http import HTTPStatus
13-
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
13+
from typing import Any, Callable, Dict, List, Match, Optional, Pattern, Set, Tuple, Type, Union
1414

1515
from aws_lambda_powertools.event_handler import content_types
1616
from aws_lambda_powertools.event_handler.exceptions import NotFoundError, ServiceError
@@ -167,7 +167,7 @@ class Route:
167167
"""Internally used Route Configuration"""
168168

169169
def __init__(
170-
self, method: str, rule: Any, func: Callable, cors: bool, compress: bool, cache_control: Optional[str]
170+
self, method: str, rule: Pattern, func: Callable, cors: bool, compress: bool, cache_control: Optional[str]
171171
):
172172
self.method = method.upper()
173173
self.rule = rule
@@ -555,7 +555,7 @@ def _resolve(self) -> ResponseBuilder:
555555
for route in self._routes:
556556
if method != route.method:
557557
continue
558-
match_results: Optional[re.Match] = route.rule.match(path)
558+
match_results: Optional[Match] = route.rule.match(path)
559559
if match_results:
560560
logger.debug("Found a registered route. Calling function")
561561
return self._call_route(route, match_results.groupdict()) # pass fn args

poetry.lock

+13-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ mkdocs-material = "^7.3.6"
5454
mkdocs-git-revision-date-plugin = "^0.3.1"
5555
mike = "^0.6.0"
5656
mypy = "^0.931"
57+
types-dataclasses = "^0.6.4"
5758

5859

5960
[tool.poetry.extras]

0 commit comments

Comments
 (0)