Avoid duplicate detectable tag (#45160)
in case of inheritance the static tags prop may be updated multiple times, and it turns out builder classes magically inherit from traditional package classes
This commit is contained in:
parent
d8a6aa551e
commit
7b644719c1
1 changed files with 3 additions and 3 deletions
|
@ -199,10 +199,10 @@ def __init__(cls, name, bases, attr_dict):
|
|||
# assumed to be detectable
|
||||
if hasattr(cls, "executables") or hasattr(cls, "libraries"):
|
||||
# Append a tag to each detectable package, so that finding them is faster
|
||||
if hasattr(cls, "tags"):
|
||||
getattr(cls, "tags").append(DetectablePackageMeta.TAG)
|
||||
else:
|
||||
if not hasattr(cls, "tags"):
|
||||
setattr(cls, "tags", [DetectablePackageMeta.TAG])
|
||||
elif DetectablePackageMeta.TAG not in cls.tags:
|
||||
cls.tags.append(DetectablePackageMeta.TAG)
|
||||
|
||||
@classmethod
|
||||
def platform_executables(cls):
|
||||
|
|
Loading…
Reference in a new issue