From da518ed0d582c761bdb10de93dfb5d2933b46271 Mon Sep 17 00:00:00 2001 From: Rasmus Wriedt Larsen Date: Thu, 23 Jul 2020 13:40:43 +0200 Subject: [PATCH] Python: CG trace: Remove Python 3.8 only f"{var=}" usage --- .../src/cg_trace/bytecode_reconstructor.py | 6 ++++-- .../recorded-call-graph-metrics/src/cg_trace/tracer.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/tools/recorded-call-graph-metrics/src/cg_trace/bytecode_reconstructor.py b/python/tools/recorded-call-graph-metrics/src/cg_trace/bytecode_reconstructor.py index 6944a42615f..cc5d86a4849 100644 --- a/python/tools/recorded-call-graph-metrics/src/cg_trace/bytecode_reconstructor.py +++ b/python/tools/recorded-call-graph-metrics/src/cg_trace/bytecode_reconstructor.py @@ -155,7 +155,9 @@ def expr_that_added_elem_to_stack( immediately. (since correctly process the bytecode when faced with jumps is not as straight forward). """ - LOGGER.debug(f"find_inst_that_added_elem_to_stack {start_index=} {stack_pos=}") + LOGGER.debug( + f"find_inst_that_added_elem_to_stack start_index={start_index} stack_pos={stack_pos}" + ) assert stack_pos >= 0 for inst in reversed(instructions[: start_index + 1]): # Return immediately if faced with a jump @@ -179,7 +181,7 @@ def expr_that_added_elem_to_stack( def expr_from_instruction(instructions: List[Instruction], index: int) -> BytecodeExpr: inst = instructions[index] - LOGGER.debug(f"expr_from_instruction: {inst} {index=}") + LOGGER.debug(f"expr_from_instruction: {inst} index={index}") if inst.opname in ["LOAD_GLOBAL", "LOAD_FAST", "LOAD_NAME", "LOAD_DEREF"]: return BytecodeVariableName(inst.argval) diff --git a/python/tools/recorded-call-graph-metrics/src/cg_trace/tracer.py b/python/tools/recorded-call-graph-metrics/src/cg_trace/tracer.py index daea79c816d..9b9088eb2f5 100644 --- a/python/tools/recorded-call-graph-metrics/src/cg_trace/tracer.py +++ b/python/tools/recorded-call-graph-metrics/src/cg_trace/tracer.py @@ -192,7 +192,7 @@ class CallGraphTracer: if event not in ["call", "c_call"]: return - LOGGER.debug(f"profilefunc {event=}") + LOGGER.debug(f"profilefunc event={event}") if event == "call": # in call, the `frame` argument is new the frame for entering the callee assert frame.f_back is not None