diff --git a/cylc/flow/parsec/empysupport.py b/cylc/flow/parsec/empysupport.py index 57762555160..04710f1e325 100644 --- a/cylc/flow/parsec/empysupport.py +++ b/cylc/flow/parsec/empysupport.py @@ -53,20 +53,11 @@ def empyprocess( os.chdir(dir_) ftempl = StringIO('\n'.join(flines)) xtempl = StringIO() - # Detect EmPy version by interpreter.file() args. - # TODO: Use importlib.metadata version() once we drop Python 3.7 - if 'name' in inspect.signature(em.Interpreter.file).parameters: - # Empy 3 - interpreter = em.Interpreter( - output=em.UncloseableFile(xtempl) - ) - else: - # Empy 4 - # dispatcher = False: raise errors to caller - interpreter = em.Interpreter( - output=em.UncloseableFile(xtempl), - dispatcher=False - ) + # Requires EmPy >= 4.1 + interpreter = em.Interpreter( + output=em.UncloseableFile(xtempl), + dispatcher=False # raise errors to caller + ) # Add `CYLC_` environment variables to the global namespace. interpreter.updateGlobals( @@ -74,7 +65,6 @@ def empyprocess( ) try: - # These args work for EmPy versions 3 and 4. interpreter.file(ftempl, locals=template_vars) except Exception as exc: lineno = interpreter.contexts[-1].identify()[1]