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 630441e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ mkdocs-material = "^7.3.6"
mkdocs-git-revision-date-plugin = "^0.3.1"
mike = "^0.6.0"
mypy = "^0.931"
types-dataclasses = "^0.6.4"


[tool.poetry.extras]
Expand Down

0 comments on commit 630441e

Please sign in to comment.