Skip to content

Commit bc01cb6

Browse files
committed
repo.ebuild: cache eapi attribute
1 parent 035675c commit bc01cb6

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/pkgcraft/repo/ebuild.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ from . cimport Repo
55

66
cdef class EbuildRepo(Repo):
77
# cached fields
8+
cdef Eapi _eapi
89
cdef tuple _masters

src/pkgcraft/repo/ebuild.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ cdef class EbuildRepo(Repo):
1919
@property
2020
def eapi(self):
2121
"""Get an ebuild repo's EAPI."""
22-
return Eapi.from_ptr(C.pkgcraft_repo_ebuild_eapi(self.ptr))
22+
if self._eapi is None:
23+
self._eapi = Eapi.from_ptr(C.pkgcraft_repo_ebuild_eapi(self.ptr))
24+
return self._eapi

0 commit comments

Comments
 (0)