How to throw an exception to a local variable in Python 2.5?

In Python 2.6+, you can handle the following exceptions:

try: # stuff except Exception as e: return 'exception %s' % type(e) 

What is equivalent in 2.5?

+7
source share
1 answer

Like this:

 try: # stuff except Exception, e: return 'exception %s' % type(e) 
+11
source

All Articles