Commit 1aa0355
committed
atom: force a fresh instance instead of using portage's intern cache
portage.dep.Atom.__new__ now interns instances in a module-level cache
keyed only by the atom string and parse flags, not by the constructor's
class. Constructing gentoolkit.atom.Atom with a string already interned
elsewhere as a plain portage.dep.Atom silently returns that cached
instance instead of one of our subclass, so methods we override (like
intersects()) resolve to portage's implementation instead of ours.
Reproduced with portage d52efac67: gentoolkit.atom.Atom() returned a
plain portage.dep.Atom whenever the same atom string had already been
interned by portage itself, which happens constantly in normal use. This
also explains why equery d was under-reporting some reverse
dependencies: portage.dep.Atom.intersects() and our own implementation
don't always agree.
Bug: https://bugs.gentoo.org/981521
Signed-off-by: Matt Turner <mattst88@gentoo.org>1 parent de9169f commit 1aa0355
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| |||
0 commit comments