On 29 April 2015 at 21:14, Dave Angel <[email protected]> wrote:

> But why are you surprised?  There's no try/except protecting the latter
> line, so the exception will be uncaught, and you'll see it reported in
> parse_string().
>

I think I meant something like this. An exception in a function is caught
by the caller. I imported the program that did this into the test program,
expecting the exception to still be caught when the parse_string was
called, by the try except else block in the mainroutine of the imported
program..

def excepter():
    raise ValueError

try:
    excepter()
except ValueError:
    print("Exception caught after function call")

REPL
>>>
Exception caught after function call
>>>


-- 
Jim

"What a rotten, failed experiment. I'll start over. Maybe dogs instead of
monkeys this time." --God
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to