Make SimulatorBridge picklable (MacOS support) (#34023)

* remove unused

* make Params (un)serializable

* move initialization after spawn

_thread.lock objects can't be pickled
This commit is contained in:
JaSpa99
2024-11-14 19:25:50 +01:00
committed by GitHub
parent 50aac48fba
commit dc73e6e2aa
2 changed files with 11 additions and 3 deletions
+5
View File
@@ -36,11 +36,16 @@ class UnknownKeyName(Exception):
cdef class Params:
cdef c_Params* p
cdef str d
def __cinit__(self, d=""):
cdef string path = <string>d.encode()
with nogil:
self.p = new c_Params(path)
self.d = d
def __reduce__(self):
return (type(self), (self.d,))
def __dealloc__(self):
del self.p