Skip to content

Commit

Permalink
FIX: Remove the clipboard isolation env variable in the kernel_conver…
Browse files Browse the repository at this point in the history
…ter script (#5331)
  • Loading branch information
Alberto-DM authored Nov 4, 2024
1 parent 6e90d31 commit 6d4daa1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ansys/aedt/core/workflows/project/kernel_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 6d4daa1

Please sign in to comment.