Skip to content

query: fix AttributeError when query includes category#64

Merged
gentoo-bot merged 1 commit into
gentoo:masterfrom
mattst88:portage-atom-more-readonly-properties
Jun 28, 2026
Merged

query: fix AttributeError when query includes category#64
gentoo-bot merged 1 commit into
gentoo:masterfrom
mattst88:portage-atom-more-readonly-properties

Conversation

@mattst88

Copy link
Copy Markdown
Contributor

portage.dep.Atom uses slots, so cpv, _cp, and _version are absent from atom.dict; copying it into Query left those attrs unset. CPV's lazy property accessors then raised AttributeError (e.g. "equery f app-shells/bash").

portage.dep.Atom uses __slots__, so cpv, _cp, and _version are
absent from atom.__dict__; copying it into Query left those attrs
unset. CPV's lazy property accessors then raised AttributeError
(e.g. "equery f app-shells/bash").

Signed-off-by: Matt Turner <mattst88@gentoo.org>

@thesamesam thesamesam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a minute to convince myself the dict hack was needed but I think it indeed is.

@gentoo-bot gentoo-bot merged commit 54a6951 into gentoo:master Jun 28, 2026
9 checks passed
@mattst88 mattst88 deleted the portage-atom-more-readonly-properties branch June 28, 2026 04:58
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.

3 participants