Skip to content

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

Open
henryiii wants to merge 1 commit into
horejsek:masterfrom
henryiii:fix-not-variable-leak
Open

fix: don't leak variables from not blocks into the outer scope#209
henryiii wants to merge 1 commit into
horejsek:masterfrom
henryiii:fix-not-variable-leak

Conversation

@henryiii

@henryiii henryiii commented Jul 20, 2026

Copy link
Copy Markdown

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
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

1 participant