diff --git a/threadpoolctl.py b/threadpoolctl.py index e6ac58d8..ceed5b88 100644 --- a/threadpoolctl.py +++ b/threadpoolctl.py @@ -1132,7 +1132,12 @@ def _find_libraries_pyodide(self): ) return - for filepath in LDSO.loadedLibsByName.as_object_map(): + if hasattr(LDSO.loadedLibsByName, "as_py_json"): # Pyodide >= 0.29 + libs_iter = LDSO.loadedLibsByName.as_py_json() + else: + libs_iter = LDSO.loadedLibsByName.as_object_map() # Pyodide < 0.29 + + for filepath in libs_iter: # Some libraries are duplicated by Pyodide and do not exist in the # filesystem, so we first check for the existence of the file. For # more details, see