[IPython-dev] __file__ bug

Ville Vainio vivainio at gmail.com
Fri Jun 30 07:13:40 EDT 2006


On 6/27/06, sebastian rooks <sebastian.rooks at free.fr> wrote:

> but in the same file, the line:
>   1484          sys.modules[prog_ns['__name__']] = FakeModule(prog_ns)
>
> modify the __file__ value through a change introduce by changeset 1322 line 39
> in FakeModule.py:
>   38            # modules should have a __file__ attribute
>   39            adict['__file__'] = __file__

It was made by Fernando to fix misbehaving help() in python 2.3
(IIRC), so I don't think I should just revert the patch. If this is
really required for py 2.3 (Fernando's input appreciated, if he still
remembers the rationale for setting the module of FakeModule.py as the
__file__ for the %run-ed file), I guess we could put a test for python
version and provide the correct __file__ for py 2.4 (and leave this
feature pseudo-broken for py 2.3, i.e. the way it is now).

-- 
Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'



More information about the IPython-dev mailing list