From 6d4daa1c0b8b798a9ff88dd7d771ff94e45fa5af Mon Sep 17 00:00:00 2001 From: Alberto Di Maria <84965833+Alberto-DM@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:51:54 +0100 Subject: [PATCH] FIX: Remove the clipboard isolation env variable in the kernel_converter script (#5331) --- .../aedt/core/workflows/project/kernel_converter.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ansys/aedt/core/workflows/project/kernel_converter.py b/src/ansys/aedt/core/workflows/project/kernel_converter.py index 2f8b4149d14..8adb60ef14e 100644 --- a/src/ansys/aedt/core/workflows/project/kernel_converter.py +++ b/src/ansys/aedt/core/workflows/project/kernel_converter.py @@ -283,6 +283,13 @@ def convert(args): files_path += search_files(args["file_path"], "*.aedt") else: files_path = [args["file_path"]] + # Remove the clipboard isolation env variable if present + env_var_name = "ANS_USE_ISOLATED_CLIPBOARD" + saved_env_var = None + if env_var_name in os.environ: + saved_env_var = os.environ[env_var_name] + del os.environ[env_var_name] + output_desktop = Desktop( new_desktop=True, version=version, @@ -303,6 +310,10 @@ def convert(args): input_desktop.release_desktop() output_desktop.release_desktop(False, False) + # Reset the clipboard isolation env variable if it was present + if saved_env_var is not None: + os.environ[env_var_name] = saved_env_var + if __name__ == "__main__": args = get_arguments(extension_arguments, extension_description)