Re: Better error message on recursive import

2008-09-12 Thread Wojtek Walczak
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

Re: Better error message on recursive import

2008-09-12 Thread Marc 'BlackJack' Rintsch
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(): >

Re: Better error message on recursive import

2008-09-12 Thread Thomas Guettler
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.

Re: Better error message on recursive import

2008-09-11 Thread Marc 'BlackJack' Rintsch
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". >

Better error message on recursive import

2008-09-11 Thread Thomas Guettler
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