Skip to content

Commit 17384f1

Browse files
committed
We do not use shared libs for cppyy_backend, revert loader.py usage
1 parent 1f9de1c commit 17384f1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

bindings/pyroot/cppyy/cppyy/python/cppyy/_cpython_cppyy.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,19 @@
1616
'_end_capture_stderr'
1717
]
1818

19-
# first load the dependency libraries of the backend, then pull in the
20-
# libcppyy extension module
21-
c = loader.load_cpp_backend()
19+
# First load the dependency libraries of the backend, then pull in the libcppyy
20+
# extension module. If the backed can't be loaded, it was probably linked
21+
# statically into the extension module, so we don't error out at this point.
22+
try:
23+
from cppyy_backend import loader
24+
c = loader.load_cpp_backend()
25+
except ImportError:
26+
c = None
27+
2228
import libcppyy as _backend
23-
_backend._cpp_backend = c
29+
30+
if c is not None:
31+
_backend._cpp_backend = c
2432

2533
# explicitly expose APIs from libcppyy
2634
import ctypes

0 commit comments

Comments
 (0)