diff options
| author | Petr Viktorin <pviktori@redhat.com> | 2015-01-16 15:24:03 +0100 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2015-02-17 15:41:11 +0100 |
| commit | a0cbce60f4dac2ef1086758299a48f2390e2e2ea (patch) | |
| tree | 21cd6af3272a73ea53fbfea4ab9fed8ab7876802 | |
| parent | fcf4a891945b22dc6eccdc71fd441f1a879f556a (diff) | |
buildtools: Use separate storage for each function in runonce
The runonce decorator used shared storage for all functions, and
dispatched only on arguments, so a call would be eliminated if
a different runonce function had already been called with the same
arguments.
Use separate storage for each decorated function.
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Simo Sorce <simo@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
| -rw-r--r-- | buildtools/wafsamba/samba_utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 9ac10666f3..df4a552dbe 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -39,8 +39,8 @@ def GET_TARGET_TYPE(ctx, target): # this is used as a decorator to make functions only # run once. Based on the idea from # http://stackoverflow.com/questions/815110/is-there-a-decorator-to-simply-cache-function-return-values -runonce_ret = {} def runonce(function): + runonce_ret = {} def runonce_wrapper(*args): if args in runonce_ret: return runonce_ret[args] |
