Skip to content

Commit

Permalink
Fix typing errors for python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Ploski committed Jan 16, 2022
1 parent 0c55c97 commit 8d23b2d
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 70 deletions.
6 changes: 3 additions & 3 deletions aws_lambda_powertools/event_handler/api_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from enum import Enum
from functools import partial
from http import HTTPStatus
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
from typing import Any, Callable, Dict, List, Match, Optional, Pattern, Set, Tuple, Type, Union

from aws_lambda_powertools.event_handler import content_types
from aws_lambda_powertools.event_handler.exceptions import NotFoundError, ServiceError
Expand Down Expand Up @@ -167,7 +167,7 @@ class Route:
"""Internally used Route Configuration"""

def __init__(
self, method: str, rule: Any, func: Callable, cors: bool, compress: bool, cache_control: Optional[str]
self, method: str, rule: Pattern, func: Callable, cors: bool, compress: bool, cache_control: Optional[str]
):
self.method = method.upper()
self.rule = rule
Expand Down Expand Up @@ -555,7 +555,7 @@ def _resolve(self) -> ResponseBuilder:
for route in self._routes:
if method != route.method:
continue
match_results: Optional[re.Match] = route.rule.match(path)
match_results: Optional[Match] = route.rule.match(path)
if match_results:
logger.debug("Found a registered route. Calling function")
return self._call_route(route, match_results.groupdict()) # pass fn args
Expand Down
Loading

0 comments on commit 8d23b2d

Please sign in to comment.