From dbd2646f4463d83a7b9b5fc54b3efb95d228a0f4 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 2 Feb 2024 18:43:21 +0100 Subject: [PATCH] fix --- snakemake_interface_common/exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snakemake_interface_common/exceptions.py b/snakemake_interface_common/exceptions.py index d2c023d..4485ae1 100644 --- a/snakemake_interface_common/exceptions.py +++ b/snakemake_interface_common/exceptions.py @@ -4,6 +4,7 @@ __license__ = "MIT" from pathlib import Path +import sys import textwrap from typing import Optional @@ -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}"