25 Nov
2005
25 Nov
'05
7:25 p.m.
2005/11/24, Chris Withers <chris@simplistix.co.uk>:
Interestingly, you can raise things that don't subclass Exception in python. This was discussed before, and I firmly agree with, that zodb conflicts should _not_ sublcass exception. That way, there's less chance of them being caught by inexperienced programmers putting in try: except Exception: 's.
How would we go about making this change?
class my_own_exception: pass try: raise my_own_exception() except: print "Doesn't help against inexperienced programmers. sadly" You can even raise a string, which is accidently done in zope2 and where my with provided solution and unit test is pending. It is better to beat people using except: without good reasons. Patrick