mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 02:01:16 +00:00
utils/exec_control: Fix once decorator implementation
Ensures that the once decorator does not affect classes in a parallel inheritance hierarchy.
This commit is contained in:
parent
b0262e5103
commit
f26d819aad
@ -1,5 +1,3 @@
|
||||
from inspect import getmro
|
||||
|
||||
# "environment" management:
|
||||
__environments = {}
|
||||
__active_environment = None
|
||||
@ -96,10 +94,7 @@ def once(method):
|
||||
if __active_environment is None:
|
||||
activate_environment('default')
|
||||
|
||||
func_id = repr(method.func_name)
|
||||
# Store the least derived class, which isn't object, to account
|
||||
# for subclasses.
|
||||
func_id += repr(getmro(args[0].__class__)[-2])
|
||||
func_id = repr(method.__code__)
|
||||
|
||||
if func_id in __environments[__active_environment]:
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user