use execute method instead of Execution creators

This commit is contained in:
Dave Halter
2013-12-28 21:21:15 +01:00
parent 37e157d441
commit 870f5da354
2 changed files with 4 additions and 4 deletions

View File

@@ -535,7 +535,7 @@ class Evaluator(object):
call_path = call.generate_call_path()
next(call_path, None) # the first one has been used already
result += self.follow_path(call_path, r, call.parent,
position=call.start_pos)
position=call.start_pos)
elif isinstance(call, pr.ListComprehension):
loop = evaluate_list_comprehension(call)
# Caveat: parents are being changed, but this doesn't matter,

View File

@@ -135,7 +135,7 @@ class Instance(use_metaclass(CachedMetaClass, Executable)):
def execute_subscope_by_name(self, name, args=()):
method = self.get_subscope_by_name(name)
return Execution(self._evaluator, method, args).get_return_types()
return self._evaluator.execute(method, args)
def get_descriptor_return(self, obj):
""" Throws a KeyError if there's no method. """
@@ -358,7 +358,7 @@ class Function(use_metaclass(CachedMetaClass, pr.IsScope)):
old_func = InstanceElement(self._evaluator, instance, old_func)
instance = None
wrappers = Execution(self._evaluator, decorator, (old_func,)).get_return_types()
wrappers = self._evaluator.execute(decorator, (old_func,))
if not len(wrappers):
debug.warning('no wrappers found', self.base_func)
return None
@@ -809,7 +809,7 @@ class Generator(use_metaclass(CachedMetaClass, pr.Base, Iterable)):
def iter_content(self):
""" returns the content of __iter__ """
return Execution(self._evaluator, self.func, self.var_args).get_return_types(True)
return self._evaluator.execute(self.func, self.var_args, True)
def get_index_types(self, index=None):
debug.warning('Tried to get array access on a generator', self)