Commit bf2cf6fd authored by Stefan Behnel's avatar Stefan Behnel

fix transitive loading of parametrised utility code

parent feefc031
...@@ -249,7 +249,12 @@ class UtilityCodeBase(object): ...@@ -249,7 +249,12 @@ class UtilityCodeBase(object):
continue continue
# only pass lists when we have to: most argument expect one value or None # only pass lists when we have to: most argument expect one value or None
if name == 'requires': if name == 'requires':
values = [cls.load_cached(dep, from_file, **orig_kwargs) if orig_kwargs:
values = [cls.load(dep, from_file, **orig_kwargs)
for dep in sorted(values)]
else:
# dependencies are rarely unique, so use load_cached() when we can
values = [cls.load_cached(dep, from_file)
for dep in sorted(values)] for dep in sorted(values)]
elif not values: elif not values:
values = None values = None
...@@ -270,7 +275,7 @@ class UtilityCodeBase(object): ...@@ -270,7 +275,7 @@ class UtilityCodeBase(object):
return cls(**kwargs) return cls(**kwargs)
@classmethod @classmethod
def load_cached(cls, utility_code_name, from_file=None, __cache={}, **kwargs): def load_cached(cls, utility_code_name, from_file=None, __cache={}):
""" """
Calls .load(), but using a per-type cache based on utility name and file name. Calls .load(), but using a per-type cache based on utility name and file name.
""" """
...@@ -279,7 +284,7 @@ class UtilityCodeBase(object): ...@@ -279,7 +284,7 @@ class UtilityCodeBase(object):
return __cache[key] return __cache[key]
except KeyError: except KeyError:
pass pass
code = __cache[key] = cls.load(utility_code_name, from_file, **kwargs) code = __cache[key] = cls.load(utility_code_name, from_file)
return code return code
@classmethod @classmethod
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment