From 927af5e7cc23b7926b1d3d81235c51bd795b22b3 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 10 Sep 2024 10:36:32 -0500 Subject: [PATCH] Make BypassStdoutInterpreter compatible with EmPy 4.x (#664) --- 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 7f2c69bc..d7d82b2e 100644 --- a/colcon_core/shell/template/__init__.py +++ b/colcon_core/shell/template/__init__.py @@ -62,9 +62,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 = {}