From a2378ba7c8dcc5a92d74ba89418f911d031ad47c Mon Sep 17 00:00:00 2001 From: Massimo Capodiferro <77293250+maxcapodi78@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:00:51 +0200 Subject: [PATCH] moved dll load at beginning of clr_module (#2929) Co-authored-by: maxcapodi78 --- pyaedt/generic/clr_module.py | 2 ++ pyaedt/generic/pdf.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyaedt/generic/clr_module.py b/pyaedt/generic/clr_module.py index 08e2cb9dd68..ef4c054a867 100644 --- a/pyaedt/generic/clr_module.py +++ b/pyaedt/generic/clr_module.py @@ -9,6 +9,7 @@ is_linux = os.name == "posix" is_windows = not is_linux is_clr = False +sys.path.append(os.path.join(pyaedt_path, "dlls", "PDFReport")) if is_linux and cpython: # pragma: no cover try: if os.environ.get("DOTNET_ROOT") is None: @@ -44,6 +45,7 @@ load("coreclr") is_clr = True + except: pass diff --git a/pyaedt/generic/pdf.py b/pyaedt/generic/pdf.py index c9a44db8da2..f673a5a55ae 100644 --- a/pyaedt/generic/pdf.py +++ b/pyaedt/generic/pdf.py @@ -1,5 +1,4 @@ import os -import sys import warnings from pyaedt import __version__ @@ -9,7 +8,6 @@ from pyaedt.generic.clr_module import _clr from pyaedt.generic.clr_module import is_clr -sys.path.append(os.path.join(pyaedt_path, "dlls", "PDFReport")) try: _clr.AddReference("AnsysReport") from AnsysReport import CreatePdfReport