Skip to content

Commit 378009e

Browse files
authored
Merge pull request #525 from actionless/patch-1
fix(event): don't attempt to import `exceptiongroup` if running python 3.11+
2 parents 7d2c52b + 13bdb45 commit 378009e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

generic/event.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
This module provides API for event management.
44
"""
55

6+
from sys import version_info
67
from typing import Callable, Set, Type
78

8-
from exceptiongroup import ExceptionGroup
9+
if version_info < (3, 11):
10+
from exceptiongroup import ExceptionGroup
911

1012
from generic.registry import Registry, TypeAxis
1113

tests/test_event_exception.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from __future__ import annotations
22

3+
from sys import version_info
34
from typing import Callable
45

56
import pytest
6-
from exceptiongroup import ExceptionGroup
7+
if version_info < (3, 11):
8+
from exceptiongroup import ExceptionGroup
79

810
from generic.event import Event, Manager
911

0 commit comments

Comments
 (0)