import BaseExceptionGroup with explicit version check instead of try/catch
This commit is contained in:
parent
b457013e97
commit
1a6a158036
|
@ -56,10 +56,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
_TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"]
|
_TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"]
|
||||||
|
|
||||||
BaseExceptionGroup: Type[BaseException]
|
if sys.version_info[:2] < (3, 11):
|
||||||
try:
|
|
||||||
BaseExceptionGroup = BaseExceptionGroup # type: ignore
|
|
||||||
except NameError:
|
|
||||||
from exceptiongroup import BaseExceptionGroup
|
from exceptiongroup import BaseExceptionGroup
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue