From ced1e985a3060de2d8e817f1d4b5c4b2b58db221 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 29 Aug 2023 13:28:59 +0200 Subject: [PATCH] one more try --- .../autopygen/source_file_parsing/constants.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/planemo/autopygen/source_file_parsing/constants.py b/planemo/autopygen/source_file_parsing/constants.py index e58ed4805..10808984a 100644 --- a/planemo/autopygen/source_file_parsing/constants.py +++ b/planemo/autopygen/source_file_parsing/constants.py @@ -1,15 +1,10 @@ # stdlib_module_names is only available from python 3.10 -# the inner try-except is essentially needed for mypy -# since we assume that stdlib-list is available -try: +if sys.version_info >= (3, 10): from sys import stdlib_module_names -except ImportError: - try: - from stdlib_list import stdlib_list - stdlib_module_names = stdlib_list() - except ImportError: - # Handle the case where stdlib_list is not available - stdlib_module_names = [] +else: + from stdlib_list import stdlib_list + + stdlib_module_names = stdlib_list() WARNING_STRING = "##!_FIXME_!##"