Skip to content

Commit

Permalink
Fix import of TypedDict for python < 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
jocelynj authored and frodrigo committed Apr 11, 2024
1 parent 6d90360 commit 09979bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions modules/GeoJSONTypes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from typing import Any, Dict, List, Literal, TypedDict

from typing import Any, Dict, List, Literal
try:
# for python < 3.12
from typing_extensions import TypedDict
except:
from typing import TypedDict

class GeoJSONFeature(TypedDict):
type: Literal["Feature"]
Expand Down
7 changes: 6 additions & 1 deletion modules/query_meta.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from collections import defaultdict
from typing import Any, Dict, List, Optional, TypedDict
from typing import Any, Dict, List, Optional
try:
# for python < 3.12
from typing_extensions import TypedDict
except:
from typing import TypedDict

from asyncpg import Connection

Expand Down

0 comments on commit 09979bb

Please sign in to comment.