tags:

views:

49

answers:

2

Hello,

try:
    for i in list:
        try:
            #python code...
        cexcept Exception,e:
            #error handler
except Exception,e:
    error handler

If in the nested try/except it errors out, does the loop continue running?

A: 

Yes, it does, since you caught the exception. Although if you just have a comment there and not a real line of code, I think Python may complain. (I haven't written Python code in a while.)

JesperE
ok great, thanks for the answer!
Joe
Yes, Python will complain. Use pass in such cases.
Tudorizer
"pass" was what I was looking for. Thanks.
JesperE
A: 

Aside from the typo for "cexcept" in the inner except, the loop should continue. Actually, the parent try/except can not be broken only by that for, but I'm sure this is just a simple example of the actual code.

Tudorizer