fixed None type appearances in CompiledObject

This commit is contained in:
Dave Halter
2014-01-24 00:57:53 +01:00
parent e587b876b6
commit 3d7522dff6
2 changed files with 5 additions and 2 deletions

View File

@@ -305,7 +305,7 @@ class Evaluator(object):
if isinstance(obj, iterable.GeneratorMethod):
return obj.execute()
if obj.isinstance(compiled.CompiledObject):
elif obj.isinstance(compiled.CompiledObject):
if obj.is_executable_class():
return [er.Instance(self, obj, params)]
else:

View File

@@ -87,6 +87,7 @@ class CompiledObject(Base):
def execute_function(self, evaluator, params):
if self.type() != 'def':
return
for name in self._parse_function_doc()[1].split():
try:
bltn_obj = _create_from_name(builtin, builtin, name)
@@ -94,7 +95,9 @@ class CompiledObject(Base):
continue
else:
if isinstance(bltn_obj, CompiledObject):
yield bltn_obj
# We want everything except None.
if bltn_obj.obj is not None:
yield bltn_obj
else:
for result in evaluator.execute(bltn_obj, params):
yield result