Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Feb 2, 2024
1 parent 10d38c8 commit dbd2646
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snakemake_interface_common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
__license__ = "MIT"

from pathlib import Path
import sys
import textwrap
from typing import Optional

Expand All @@ -27,7 +28,7 @@ def format_arg(self, arg):
return "{}{}:\n{}".format(
arg.__class__.__name__, spec, textwrap.indent(str(arg), " ")
)
elif isinstance(arg, ExceptionGroup):
elif sys.version_info >= (3, 11) and isinstance(arg, ExceptionGroup): # noqa: F821
return "\n".join(self.format_arg(exc) for exc in arg.exceptions)
else:
return f"{arg.__class__.__name__}: {arg}"
Expand Down

0 comments on commit dbd2646

Please sign in to comment.