mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user