|
23 | 23 | __all__ = ['PythonExecutor'] |
24 | 24 |
|
25 | 25 |
|
26 | | -def _update_states(init_memory_dump: MemoryDump, state_before: MemoryDump) -> MemoryDump: |
27 | | - for id_, obj in state_before.objects.items(): |
28 | | - if id_ not in init_memory_dump.objects: |
| 26 | +def _update_states(init_memory_dump: MemoryDump, before_memory_dump: MemoryDump) -> MemoryDump: |
| 27 | + for id_, obj in before_memory_dump.objects.items(): |
| 28 | + if id_ in init_memory_dump.objects: |
| 29 | + init_memory_dump.objects[id_].comparable = obj.comparable |
| 30 | + else: |
29 | 31 | init_memory_dump.objects[id_] = obj |
30 | 32 | return init_memory_dump |
31 | 33 |
|
@@ -98,15 +100,16 @@ def run_function(self, request: ExecutionRequest) -> ExecutionResponse: |
98 | 100 | args = [loader.load_object(PythonId(arg_id)) for arg_id in request.arguments_ids] |
99 | 101 | logging.debug("Arguments: %s", args) |
100 | 102 | kwargs = {name: loader.load_object(PythonId(kwarg_id)) for name, kwarg_id in request.kwarguments_ids.items()} |
| 103 | + logging.debug("Kwarguments: %s", kwargs) |
101 | 104 | except Exception as _: |
102 | 105 | logging.debug("Error \n%s", traceback.format_exc()) |
103 | 106 | return ExecutionFailResponse("fail", traceback.format_exc()) |
104 | 107 | logging.debug("Arguments have been created") |
105 | 108 |
|
106 | 109 | try: |
107 | | - state_before_memory = _load_objects(args + list(kwargs.values())) |
108 | | - init_state_before = _update_states(loader.reload_id(), state_before_memory) |
109 | | - serialized_state_init = serialize_memory_dump(init_state_before) |
| 110 | + state_init_memory = _load_objects(args + list(kwargs.values())) |
| 111 | + state_init = _update_states(loader.reload_id(), state_init_memory) |
| 112 | + serialized_state_init = serialize_memory_dump(state_init) |
110 | 113 |
|
111 | 114 | def _coverage_sender(info: typing.Tuple[str, int]): |
112 | 115 | if pathlib.Path(info[0]) == pathlib.Path(request.filepath): |
|
0 commit comments