From 414beda7b48e4358fe4acda12af31b14d966dccf Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Fri, 6 Sep 2024 15:12:47 -0500 Subject: [PATCH] Make BypassStdoutInterpreter compatible with EmPy 4.x --- colcon_core/shell/template/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/colcon_core/shell/template/__init__.py b/colcon_core/shell/template/__init__.py index c6ba3476..e570e7c2 100644 --- a/colcon_core/shell/template/__init__.py +++ b/colcon_core/shell/template/__init__.py @@ -61,9 +61,12 @@ def expand_template(template_path, destination_path, data): class BypassStdoutInterpreter(Interpreter): """Interpreter for EmPy which keeps `stdout` unchanged.""" - def installProxy(self): # noqa: D102 N802 + def installProxy(self, *args, **kwargs): # noqa: D102 N802 # avoid replacing stdout with ProxyFile - pass + # in EmPy 3.x, this function performed in-place modification. + # in EmPy 4.x, it is passed the output stream and is expected to + # return the output stream. + return next(iter(args), None) cached_tokens = {}