From 13584f9ffb0db86ab5d6a5f9ae311630056a66fb Mon Sep 17 00:00:00 2001 From: fliiiix Date: Thu, 19 Dec 2024 10:22:06 +0100 Subject: [PATCH] RecursionError now exist in all supported versions --- radish/compat.py | 8 -------- radish/parser.py | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 radish/compat.py diff --git a/radish/compat.py b/radish/compat.py deleted file mode 100644 index 24157304..00000000 --- a/radish/compat.py +++ /dev/null @@ -1,8 +0,0 @@ -""" -This module provide Python 3 compatability -""" - -import sys - -# RecursionError does not exist in Python < 3.5 -RecursionError = RuntimeError if sys.version_info < (3, 5) else RecursionError diff --git a/radish/parser.py b/radish/parser.py index 32cf9b5a..2479d54b 100644 --- a/radish/parser.py +++ b/radish/parser.py @@ -11,7 +11,6 @@ import copy import string -from .compat import RecursionError from .exceptions import RadishError, FeatureFileSyntaxError, LanguageNotSupportedError from .feature import Feature from .scenario import Scenario @@ -517,7 +516,7 @@ def _parse_precondition(self, arguments): try: current_tags = self._current_tags + self.feature.tags + self._inherited_tags feature = self._core.parse_feature(feature_file, self._tag_expr, inherited_tags=current_tags) - except (RuntimeError, RecursionError) as e: + except RecursionError as e: if str(e).startswith("maximum recursion depth exceeded"): # precondition cycling raise FeatureFileSyntaxError( "Your feature '{0}' has cycling preconditions with '{1}: {2}' starting at line {3}".format(