Skip to content

UnboundLocalError where the unassigned variable is a function #127445

@aer0aa

Description

@aer0aa

Bug report

Bug description:

It gives this error:

Traceback (most recent call last):
  File "C:\Users\calev\Documents\solitaire.py", line 198, in <module>
    move()
  File "C:\Users\calev\Documents\solitaire.py", line 90, in move
    tmr = int(tmr)
UnboundLocalError: cannot access local variable 'int' where it is not associated with a value

I haven't been able to replicate this and I think the whole code is too long to include in this report, so I've linked to it here, answer "M" and then anything to get the error. This happens to all uses of int() in the move() function, and it keeps happening even when I rename or move it.
I'm on Windows 11

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions