[mod_python] loading mod_python.apache module interactively

Gregory (Grisha) Trubetskoy grisha at modpython.org
Wed May 5 22:50:00 EST 2004


On Thu, 6 May 2004, Gregory Bond wrote:

> > ImportError: No module named _apache
>
> See the FAQ: http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.002.htp
>
> >If I wind up issuing the same import statement a second time, it works just
> >fine, and I can work interactively w/ the apache module and what not.
>
> This I find very surprising.....

That's the way Python works - even though errors were raised in the
process, mod_python.apache will be considered loaded.

Try this little experiment:

I have an err.py like this:

  x = 1/0

now:

>>> import err
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "err.py", line 2, in ?
    x = 1/0
ZeroDivisionError: integer division or modulo by zero
>>> import err
>>>

see - second time - no error :)

Grisha




More information about the Mod_python mailing list