summaryrefslogtreecommitdiff
path: root/tools/mpy_ld.py
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2023-08-09 18:22:01 +1000
committerDamien George <damien@micropython.org>2023-08-16 16:16:44 +1000
commitb8189d039d0a9cbda54a7cab8cf12a0aee9603a0 (patch)
tree7ff51d8c1b879350cc6aede929ae166d8417334c /tools/mpy_ld.py
parent974f99482cc54fdc9be1623569c46e4be569ebd6 (diff)
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 <angus@redyak.com.au>
Diffstat (limited to 'tools/mpy_ld.py')
-rwxr-xr-xtools/mpy_ld.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/mpy_ld.py b/tools/mpy_ld.py
index 87e57869f..60fa41ce1 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