Skip to content

Commit

Permalink
🔨 Fix import for Protocols support regardless of Python version (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
fennel-akunesh authored Dec 2, 2023
1 parent 2f9d7a1 commit 3e35824
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rodi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
get_type_hints,
)

if sys.version_info >= (3, 9): # pragma: no cover
from typing import _no_init_or_replace_init as _no_init
elif sys.version_info >= (3, 8): # pragma: no cover
from typing import _no_init
if sys.version_info >= (3, 8): # pragma: no cover
try:
from typing import _no_init_or_replace_init as _no_init
except ImportError: # pragma: no cover
from typing import _no_init

try:
from typing import Protocol
Expand Down

0 comments on commit 3e35824

Please sign in to comment.