From b8189d039d0a9cbda54a7cab8cf12a0aee9603a0 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 9 Aug 2023 18:22:01 +1000 Subject: [PATCH] tools/mpy_ld.py: Pre-declare some local variables to appease linter. Spurious fix as the logic is structured such that these variables will be set before dereferenced, but this keeps Ruff happy (no more F821 undefined-name). Signed-off-by: Angus Gratton --- tools/mpy_ld.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py index 87e57869f6..60fa41ce1f 100755 --- a/tools/mpy_ld.py +++ b/tools/mpy_ld.py @@ -966,6 +966,9 @@ def build_mpy(env, entry_offset, fmpy, native_qstr_vals, native_qstr_objs): # MPY: relocation information prev_kind = None + prev_base = None + prev_offset = None + prev_n = None for base, addr, kind in env.mpy_relocs: if isinstance(kind, str) and kind.startswith(".text"): kind = 0