From 5ff85a3febe2ecdd494fe3c6e788fff3ab4371ba Mon Sep 17 00:00:00 2001 From: mrauter1 Date: Sat, 7 Oct 2023 10:29:52 -0300 Subject: [PATCH] Title: Adjust shell language switch in execute_code for Docker usage (#139) Description: This commit modifies the conditional check in execute_code to ensure the switch to PowerShell on Windows only occurs when Docker is not being used. This keeps shell script execution consistent within a Docker container across all platforms, aligning with the function's intended behavior. Co-authored-by: Xiaoyun Zhang --- autogen/code_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen/code_utils.py b/autogen/code_utils.py index 4e76b70738c..ff97f567de5 100644 --- a/autogen/code_utils.py +++ b/autogen/code_utils.py @@ -259,7 +259,7 @@ def execute_code( timeout = timeout or DEFAULT_TIMEOUT original_filename = filename - if WIN32 and lang in ["sh", "shell"]: + if WIN32 and lang in ["sh", "shell"] and (not use_docker): lang = "ps1" if filename is None: code_hash = md5(code.encode()).hexdigest()