Skip to content

fix loop scoping bug#1449

Merged
davidism merged 1 commit intopallets:3.0.xfrom
amy-lei:loop-scoping
Aug 9, 2021
Merged

fix loop scoping bug#1449
davidism merged 1 commit intopallets:3.0.xfrom
amy-lei:loop-scoping

Conversation

@amy-lei
Copy link
Copy Markdown
Contributor

@amy-lei amy-lei commented May 21, 2021

fixes #1427

changes in f524bcc caused assignments in nested loops to still be referenced after the end of the iteration. now, all variables assigned in loops will be cleared from the top level so that jinja won't attempt to resolve them outside of the loop.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@davidism davidism added this to the 3.0.2 milestone May 21, 2021
@davidism
Copy link
Copy Markdown
Member

Remember to rebase to 3.0.x

@davidism davidism changed the base branch from main to 3.0.x May 21, 2021 18:20
@davidism davidism merged commit 02071b3 into pallets:3.0.x Aug 9, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AssertionError: Tried to resolve a name to a reference that was unknown to the frame

2 participants