Skip to content

Commit

Permalink
tools/mpy_ld.py: Pre-declare some local variables to appease linter.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
projectgus authored and dpgeorge committed Aug 16, 2023
1 parent 974f994 commit b8189d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/mpy_ld.py
Expand Up @@ -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
Expand Down

0 comments on commit b8189d0

Please sign in to comment.