N
Nishkar Grover
I'm trying to replace a built-in exception type and here's a simplified
example of what I was hoping to do...
.... bar = 'bar'
........ raise ZeroDivisionError
.... except ZeroDivisionError, e:
.... print e.bar
....
bar.... 1/0
.... except ZeroDivisionError, e:
.... print e.bar
....
Traceback (most recent call last):
Notice that I get my customized exception type when I explicitly raise
ZeroDivisionError but not when that is implicitly raised by 1/0. It
seems like I have to replace that exception type at some lower level,
but I'm not sure how/where. Does anyone know of a way to do this?
- Nishkar
example of what I was hoping to do...
.... bar = 'bar'
........ raise ZeroDivisionError
.... except ZeroDivisionError, e:
.... print e.bar
....
bar.... 1/0
.... except ZeroDivisionError, e:
.... print e.bar
....
Traceback (most recent call last):
Notice that I get my customized exception type when I explicitly raise
ZeroDivisionError but not when that is implicitly raised by 1/0. It
seems like I have to replace that exception type at some lower level,
but I'm not sure how/where. Does anyone know of a way to do this?
- Nishkar