diff --git a/CLI/actioner/sonic_cli_mclag.py b/CLI/actioner/sonic_cli_mclag.py index f4c38581a2..68a8aa1292 100755 --- a/CLI/actioner/sonic_cli_mclag.py +++ b/CLI/actioner/sonic_cli_mclag.py @@ -351,8 +351,8 @@ def mclag_show_mclag_interface(args): else: #error response - print api_response - print api_response.error_message() + print(api_response) + print(api_response.error_message()) return @@ -406,8 +406,8 @@ def mclag_show_mclag_brief(args): else: #error response - print api_response - print api_response.error_message() + print(api_response) + print(api_response.error_message()) return @@ -425,7 +425,7 @@ def run(func, args): return except Exception as e: - print sys.exc_value + print(sys.exc_value) return diff --git a/CLI/klish/patches/klish-2.1.4/plugins/clish/call_pyobj.c b/CLI/klish/patches/klish-2.1.4/plugins/clish/call_pyobj.c index 40559117ea..94aab058fa 100644 --- a/CLI/klish/patches/klish-2.1.4/plugins/clish/call_pyobj.c +++ b/CLI/klish/patches/klish-2.1.4/plugins/clish/call_pyobj.c @@ -25,8 +25,14 @@ #include #include #include +#include void pyobj_init() { + void *python_lib = dlopen("libpython3.11.so.1.0", RTLD_NOW | RTLD_GLOBAL); + if (!python_lib) { + fprintf(stderr, "Failed to load Python library: %s\n", dlerror()); + } + Py_Initialize(); }