Fix: Python 3.13 optimized scope locals with exec#7
Merged
FoamyGuy merged 1 commit intoadafruit:mainfrom Feb 11, 2026
Merged
Conversation
FoamyGuy
approved these changes
Feb 11, 2026
Contributor
FoamyGuy
left a comment
There was a problem hiding this comment.
Looks good to me. Tested successfully on CircuitPython Adafruit CircuitPython 10.1.0-beta.1-36-g020c7932d0 on 2026-02-10; Adafruit Fruit Jam with rp2350b and CPython 3.13
adafruit-adabot
pushed a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Feb 12, 2026
Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 6.1.0 from 6.0.4: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#134 from adafruit/mqtt-integration-tests-cpython Updating https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer to 4.8.0 from 4.7.1: > Merge pull request adafruit/Adafruit_CircuitPython_HTTPServer#111 from michalpokusa/feature/websocket-cont-opcode-support Updating https://github.com/adafruit/Adafruit_CircuitPython_TemplateEngine to 2.0.7 from 2.0.6: > Merge pull request adafruit/Adafruit_CircuitPython_TemplateEngine#7 from michalpokusa/python-3.13-locals-fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🪛Fixes:
execdoes not implicitly updatelocals()which always results inKeyError, regardless of the template content. To retain current behavior it is necessary to pass a manually created dict, which is also a recommended way of doing thisRelated links:
https://docs.python.org/3/whatsnew/3.13.html#defined-mutation-semantics-for-locals
https://peps.python.org/pep-0667/