Python UnboundLocalError: blame a different line
The traceback points at a print call. The cause is an assignment two lines further down, inside an if branch that never ran. Here's how Python knew about it.
9 min read
On Python from the first script to an API: what the error messages mean and how to work with code that runs.
RSS