>One idea that seems to work is setting __name__ = '__main__'
Or, del sys.modules[__name__].
--
http://mail.python.org/mailman/listinfo/python-list
Thank you, Dieter! Bingo.
When I think about it now, it is very logical: There must be another
mechanism besides sys.path, otherwise modules inside packages would not
find their siblings or subpackages.
But whereever the search path is explained, only sys.path was mentioned,
so I took that at
Christoph Zwerschke <[EMAIL PROTECTED]> writes on Tue, 20 Sep 2005 11:20:37
+0200:
> Just hitting a strange problem with Python import behavior. It is the
> same on all Python 2.x versions and it is probably correct, but I
> currently don't understand why this happens.
> ...
> --- dir/__init__.py
Just hitting a strange problem with Python import behavior. It is the
same on all Python 2.x versions and it is probably correct, but I
currently don't understand why this happens.
I have created a directory "dir" with the following three module,
__init__, hello, and test2; and another module t