diff --git a/generic/event.py b/generic/event.py index 49ee53c..8f63b4d 100644 --- a/generic/event.py +++ b/generic/event.py @@ -3,9 +3,11 @@ This module provides API for event management. """ +from sys import version_info from typing import Callable, Set, Type -from exceptiongroup import ExceptionGroup +if version_info < (3, 11): + from exceptiongroup import ExceptionGroup from generic.registry import Registry, TypeAxis diff --git a/tests/test_event_exception.py b/tests/test_event_exception.py index f471c9a..d1dd899 100644 --- a/tests/test_event_exception.py +++ b/tests/test_event_exception.py @@ -1,9 +1,11 @@ from __future__ import annotations +from sys import version_info from typing import Callable import pytest -from exceptiongroup import ExceptionGroup +if version_info < (3, 11): + from exceptiongroup import ExceptionGroup from generic.event import Event, Manager