Customize serialization to exclude non-picklable client objects. This method is called by pickle when saving the object's state.
(self)
| 88 | } |
| 89 | |
| 90 | def __getstate__(self): |
| 91 | """ |
| 92 | Customize serialization to exclude non-picklable client objects. |
| 93 | This method is called by pickle when saving the object's state. |
| 94 | """ |
| 95 | state = self.__dict__.copy() |
| 96 | # Remove the unpicklable client instances |
| 97 | if 'sync_client' in state: |
| 98 | del state['sync_client'] |
| 99 | if 'async_client' in state: |
| 100 | del state['async_client'] |
| 101 | return state |
| 102 | |
| 103 | def __setstate__(self, state): |
| 104 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected