Customize serialization to exclude non-picklable client objects. This method is called by pickle when saving the object's state.
(self)
| 625 | } |
| 626 | |
| 627 | def __getstate__(self): |
| 628 | """ |
| 629 | Customize serialization to exclude non-picklable client objects. |
| 630 | This method is called by pickle when saving the object's state. |
| 631 | """ |
| 632 | state = self.__dict__.copy() |
| 633 | # Remove the unpicklable client instances |
| 634 | if 'sync_client' in state: |
| 635 | del state['sync_client'] |
| 636 | if 'async_client' in state: |
| 637 | del state['async_client'] |
| 638 | return state |
| 639 | |
| 640 | def __setstate__(self, state): |
| 641 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected