Skip to content

Commit 7aeea71

Browse files
committed
Fix loading issue for Python custom operators
1 parent 2b77e98 commit 7aeea71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ansys/dpf/core/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
spec = pkgutil.get_loader(__name__)
1717
USER_DATA_PATH = os.path.dirname(spec.get_filename(__name__))
18+
# Handle the case of ansys-dpf-core loaded in dpf-site.zip for Python custom operators
19+
if "dpf-site.zip" in USER_DATA_PATH:
20+
from tempfile import mkdtemp
21+
USER_DATA_PATH = mkdtemp(prefix="PyDPF-Core_")
1822
if not os.path.exists(USER_DATA_PATH): # pragma: no cover
1923
os.makedirs(USER_DATA_PATH)
2024

0 commit comments

Comments
 (0)