On Thu, 11 Sep 2008 12:43:34 +0200, Thomas Guettler wrote:
Hello,
> why does Python only raise ImportError if it fails caused by a recursive
> import?
>
> I know what's wrong. But I guess many beginner don't know what's wrong.
I don't think that you're right here. I can't remember any beginner
On Fri, 12 Sep 2008 09:47:42 +0200, Thomas Guettler wrote:
>> Can you give an example of such a recursive import you want the special
>> exception be raised?
>
> ===> cat one.py
> from two import testtwo
> def testone():
> print "one"
>
> ===> cat two.py
> import one
> def testtwo():
>
Hi,
Can you give an example of such a recursive import you want the special
exception be raised?
===> cat one.py
from two import testtwo
def testone():
print "one"
===> cat two.py
import one
def testtwo():
print "two"
===> python one.py
Traceback (most recent call last):
File "one.
On Thu, 11 Sep 2008 12:43:34 +0200, Thomas Guettler wrote:
> why does Python only raise ImportError if it fails caused by a recursive
> import?
>
> I know what's wrong. But I guess many beginner don't know what's wrong.
> I don't want much, just "RecursiveImportError" instead of "ImportError".
>
Hi,
why does Python only raise ImportError if it fails caused by a recursive import?
I know what's wrong. But I guess many beginner don't know what's wrong. I don't
want much, just "RecursiveImportError" instead of "ImportError". Is this
possible?
Thomas
--
Thomas Guettler, http://www.thoma