In Python 2.6+, you can handle exceptions like this:
try:
# stuff
except Exception as e:
return 'exception %s' % type(e)
What is the equivalent in 2.5?
Like this :
try:
# stuff
except Exception, e:
return 'exception %s' % type(e)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With