Skip to content

Commit 7c6c3e2

Browse files
Revert graceful checking for dynlib duplication
1 parent f70fa86 commit 7c6c3e2

File tree

1 file changed

+4
-30
lines changed

1 file changed

+4
-30
lines changed

pyodide_pack/loader/pyodide_pack_loader.py

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,8 @@
33

44
async def setup():
55
"""Load dynamic libraries in the pyodide-pack bundle"""
6-
try:
7-
from pyodide_js import _module
6+
from pyodide_js import _module
87

9-
# We need to handle duplicate shared libraries carefully. Many packages
10-
# that depend on static/shared libraries like h5py and netcdf4 may include
11-
# them (such as libhdf5_hl.so); loading them more than once, especially one
12-
# by one instead of their dependent order may cause errors.
13-
14-
loaded_libs = set()
15-
so_list_path = Path("/bundle-so-list.txt")
16-
if not so_list_path.exists():
17-
print(f"Warning: {so_list_path} not found")
18-
return
19-
20-
for line in so_list_path.read_text().splitlines():
21-
try:
22-
path, is_shared = line.split(",")
23-
24-
if path in loaded_libs:
25-
continue
26-
27-
lib_basename = Path(path).name
28-
if any(lib_basename == Path(loaded).name for loaded in loaded_libs):
29-
continue
30-
31-
await _module.API.loadDynlib(path, bool(is_shared))
32-
loaded_libs.add(path)
33-
except Exception as e:
34-
print(f"Warning: Failed to load {path}: {str(e)}")
35-
except Exception as e:
36-
print(f"Error in setup: {str(e)}")
8+
for paths in Path("/bundle-so-list.txt").read_text().splitlines():
9+
path, is_shared = paths.split(",")
10+
await _module.API.loadDynlib(path, bool(is_shared))

0 commit comments

Comments
 (0)