diff --git a/lib/spack/spack/mixins.py b/lib/spack/spack/mixins.py index d757a963b3..2ce80c4c39 100644 --- a/lib/spack/spack/mixins.py +++ b/lib/spack/spack/mixins.py @@ -118,6 +118,9 @@ def __init__(cls, name, bases, attr_dict): for f in fn_list: phase_obj.run_before.append(f) + # Flush the dictionary for the next class + PackageMixinsMeta._add_method_before.clear() + for phase in PackageMixinsMeta._add_method_after: attr_name = attr_fmt.format(phase) @@ -127,6 +130,9 @@ def __init__(cls, name, bases, attr_dict): for f in fn_list: phase_obj.run_after.append(f) + # Flush the dictionary for the next class + PackageMixinsMeta._add_method_after.clear() + super(PackageMixinsMeta, cls).__init__(name, bases, attr_dict)