From eae72638385fd61932c9ed98ce7ee078c28882f0 Mon Sep 17 00:00:00 2001 From: alalazo Date: Mon, 19 Jun 2017 15:38:37 +0200 Subject: [PATCH] mixins: flush method dictionaries after registration. --- lib/spack/spack/mixins.py | 6 ++++++ 1 file changed, 6 insertions(+) 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)