maximum recursion depth exceeded

Mike Romberg romberg at smaug.fsl.noaa.gov
Tue Mar 4 13:52:36 EST 2003


  I'm attempting to try and gracefully handle situations where
infinite recursion can occur in scripts supplied to our system by our
users.  To do this I've tried the following:


try:
    eval("Some code which might recurse")
except exceptions.RuntimeError:
    # Handle error

  When I supply a string which causes infinite recursion, I see these
messages on the console:

Exception exceptions.RuntimeError: 'maximum recursion depth exceeded'
in  ignored

  But I can't seem to catch the exceptions.  Is there something
special about this exception?  Or am I just missing something obvious
(which I have been know to do from time to time).

Thanks,

Mike Romberg (romberg at fsl.noaa.gov)








More information about the Python-list mailing list