From 909e9dc820c8a68d0c07d4677f038b1a759f93fa Mon Sep 17 00:00:00 2001 From: Hilary James Oliver Date: Fri, 20 Oct 2023 14:10:16 +1300 Subject: [PATCH] Update cylc/flow/subprocpool.py Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> --- cylc/flow/subprocpool.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cylc/flow/subprocpool.py b/cylc/flow/subprocpool.py index 12e202c1699..2e32057515c 100644 --- a/cylc/flow/subprocpool.py +++ b/cylc/flow/subprocpool.py @@ -87,11 +87,8 @@ def get_func(mod_name, func_name, src_dir): mod_by_name = __import__(mod_name, fromlist=[mod_name]) except ImportError: # 2. look in built-in xtriggers. - mod_name = "%s.%s" % ("cylc.flow.xtriggers", mod_name) - try: - mod_by_name = __import__(mod_name, fromlist=[mod_name]) - except ImportError: - raise + mod_name = f"cylc.flow.xtriggers.{mod_name}" + mod_by_name = __import__(mod_name, fromlist=[mod_name]) # Module found and imported, return the named function.