Skip to content

Fix wrong variable in exclude filter error message#6607

Open
RajanChavada wants to merge 1 commit into
Textualize:mainfrom
RajanChavada:fix/query-exclude-error-message
Open

Fix wrong variable in exclude filter error message#6607
RajanChavada wants to merge 1 commit into
Textualize:mainfrom
RajanChavada:fix/query-exclude-error-message

Conversation

@RajanChavada

Copy link
Copy Markdown

Link to issue or discussion

Found during code review — copy-paste bug in css/query.py. No existing issue; the fix is a single character change with no ambiguity.

What this PR does

When exclude= is passed to a query and the selector fails to parse, the raised InvalidQueryFormat message incorrectly references filter (and its value) instead of exclude:

# before (L108)
raise InvalidQueryFormat(f"Unable to parse filter {filter!r} as query")

# after
raise InvalidQueryFormat(f"Unable to parse exclude {exclude!r} as query")

The filter branch directly above (L102) is correct — this was a copy-paste of that line without updating the variable name.

Testing

All 16 existing tests/test_query.py tests pass. No logic changed, error message string only.

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.

1 participant