Skip to content

Commit 7f3d872

Browse files
committed
🐛 Fix msgspec recipe import on Python 3.8/3.9
The msgspec recipe added in #3316 uses PEP 585 generic syntax (dict[str, Any]) in function signatures. Python 3.8 raises "TypeError: 'type' object is not subscriptable" at import time because dict only became subscriptable at runtime in Python 3.9. Adding `from __future__ import annotations` defers annotation evaluation to strings (PEP 563), restoring 3.8 compatibility. This release still officially supports Python 3.8 / 3.9.
1 parent e928129 commit 7f3d872

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pythonforandroid/recipes/msgspec/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from typing import Any
24

35
from pythonforandroid.archs import Arch

0 commit comments

Comments
 (0)