Skip to content

Commit 1711d27

Browse files
committed
query: fix missing operator attribute on Query objects
portage.dep.Atom now uses __slots__ and exposes operator as a read-only @Property backed by _operator, so it no longer appears in atom.__dict__. Query.__init__ copies atom.__dict__ into self but never picked up operator, same gap already patched here for cpv, _version, and _cp. Dependencies (a Query subclass) then lacked .operator entirely, crashing equery d with AttributeError when Atom.intersects() compared against it. Bug: https://bugs.gentoo.org/981521 Signed-off-by: Matt Turner <mattst88@gentoo.org>
1 parent a90f843 commit 1711d27

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pym/gentoolkit/query.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def __init__(self, query, is_regex=False):
6868
for _attr in ("_version", "_cp"):
6969
if _attr not in self.__dict__:
7070
setattr(self, _attr, None)
71+
# gentoolkit.atom.Atom's operator is a read-only @property,
72+
# never a plain instance attribute, so it's never in
73+
# atom.__dict__ either.
74+
self.operator = atom.operator
7175
except errors.GentoolkitInvalidAtom:
7276
CPV.__init__(self, self.query)
7377
self.operator = ""

0 commit comments

Comments
 (0)