How is the scoping of variables handled during exceptions? I suppose this will be language specific, and answers for any specific language are greatly appreciated. At least maybe the big ones? C++, python, Java
. This is what I mean:
python
try:
for k, v in map.iteritems():
cnf.conf.set( section, k, v )
for i, j in map2.iteritems():
dosomethingelse()
for m in range(10):
morestuff()
except SpecificError:
vars = (k, v, i, j, m)
finally:
vars in scope #?
Or something more complicated, like nested blocks:
try:
try:
for k, v in map.iteritems():
cnf.conf.set( section, k, v )
for i, j in map2.iteritems():
dosomethingelse()
for m in range(10):
morestuff()
except SpecificError:
vars = (k, v, i, j, m)
except:
vars in scope #?