Skip to content

Commit

Permalink
dep: only call C method for Dependency.conditional for the correct kind
Browse files Browse the repository at this point in the history
Rather than calling into the shared library for all types.
  • Loading branch information
radhermit committed Dec 10, 2023
1 parent 73da27b commit afc5684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pkgcraft/dep/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ cdef class Dependency:
@property
def conditional(self):
"""Return the conditional UseDep for a Dependency if it exists."""
if ptr := C.pkgcraft_dependency_conditional(self.ptr):
return UseDep.from_ptr(ptr)
if self.kind == DependencyKind.UseConditional:
return UseDep.from_ptr(C.pkgcraft_dependency_conditional(self.ptr))
return None

def evaluate(self, enabled=()):
Expand Down

0 comments on commit afc5684

Please sign in to comment.