Skip to content

Commit cf38a18

Browse files
Use as_py_json in place of deprecated as_object_map for Pyodide>=0.29 (#201)
1 parent 1b35392 commit cf38a18

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

threadpoolctl.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,12 @@ def _find_libraries_pyodide(self):
11321132
)
11331133
return
11341134

1135-
for filepath in LDSO.loadedLibsByName.as_object_map():
1135+
if hasattr(LDSO.loadedLibsByName, "as_py_json"): # Pyodide >= 0.29
1136+
libs_iter = LDSO.loadedLibsByName.as_py_json()
1137+
else:
1138+
libs_iter = LDSO.loadedLibsByName.as_object_map() # Pyodide < 0.29
1139+
1140+
for filepath in libs_iter:
11361141
# Some libraries are duplicated by Pyodide and do not exist in the
11371142
# filesystem, so we first check for the existence of the file. For
11381143
# more details, see

0 commit comments

Comments
 (0)