__file__ should be listed as a module attribute.

This commit is contained in:
Dave Halter
2014-11-13 00:24:40 +01:00
parent 408eee50dd
commit f0a3c37fa0
3 changed files with 2 additions and 4 deletions

View File

@@ -336,7 +336,7 @@ class LazyName(FakeName):
@parent.setter
def parent(self, value):
pass # Do nothing, lower level can try to set the parent.
pass # Do nothing, super classes can try to set the parent.
def stmts_to_stmt(statements):

View File

@@ -71,7 +71,6 @@ class GeneratorMixin(object):
return [self.iter_content()[index]]
class Generator(use_metaclass(CachedMetaClass, IterableWrapper, GeneratorMixin)):
"""Handling of `yield` functions."""
def __init__(self, evaluator, func, var_args):
@@ -155,7 +154,6 @@ class ListComprehension(Comprehension):
return self._evaluator.eval_element(self.eval_node())
class GeneratorComprehension(Comprehension, GeneratorMixin):
def iter_content(self):
return self._evaluator.eval_element(self.eval_node())

View File

@@ -706,7 +706,7 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, pr.Module, Wrapper)):
@memoize_default()
def _module_attributes(self):
def parent_callback():
return Instance(self._evaluator, compiled.create(self._evaluator, str))
return self._evaluator.execute(compiled.create(self._evaluator, str))[0]
names = ['__file__', '__package__', '__doc__', '__name__', '__version__']
# All the additional module attributes are strings.