Skip to content

fix: don't leak variables from not blocks into the outer scope - #209

Merged
horejsek merged 2 commits into
horejsek:masterfrom
henryiii:fix-not-variable-leak
Jul 25, 2026
Merged

fix: don't leak variables from not blocks into the outer scope#209
horejsek merged 2 commits into
horejsek:masterfrom
henryiii:fix-not-variable-leak

Conversation

@henryiii

@henryiii henryiii commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This is a proposed fix for top level not generating invalid Python code. Turned out to be a one-line fix.

Fixes #208

🤖

Assisted-by: ClaudeCode:claude-fable-5

Variables created while generating a `not` subschema stayed in the
generator's variable-tracking set, so outer keywords like
`additionalProperties` reused them instead of emitting their own
assignments. Since the `not` block only succeeds by raising partway
through, validating a passing document raised UnboundLocalError.

Fixes horejsek#208

Assisted-by: ClaudeCode:claude-fable-5
@pygarap

pygarap commented Jul 24, 2026

Copy link
Copy Markdown

@horejsek Would you mind sharing whether this is likely to be merged in the near future? Thank you for your time and consideration.

@horejsek
horejsek merged commit 1fa8834 into horejsek:master Jul 25, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnboundLocalError: data_keys in generated code for additionalProperties: false + root-level not with properties

3 participants