安全销毁 OutputReturn 对象/包含OutputReturn对象的dict/list, 使 OutputReturn.__del__ 不进行任何操作
(cls, obj)
| 56 | |
| 57 | @classmethod |
| 58 | def safely_destruct(cls, obj): |
| 59 | """安全销毁 OutputReturn 对象/包含OutputReturn对象的dict/list, 使 OutputReturn.__del__ 不进行任何操作""" |
| 60 | try: |
| 61 | json.dumps(obj, default=partial(cls.json_encoder, ignore_error=True)) |
| 62 | except Exception: |
| 63 | pass |
| 64 | |
| 65 | def __init__(self, spec, on_embed=None): |
| 66 | self.processed = False |