Re: Python 2-3 compatibility

2013-06-02 Thread Terry Jan Reedy
On 6/2/2013 10:13 AM, Jason Swails wrote: Because Python 2.4 and 2.5 don't support the except Exception as err: syntax, I've used except Exception, err: Is there any way of getting this effect in a way compatible with Py2.4 and 3.x? Don't do either. Just catch the exception with 'except Ex

Re: Python 2-3 compatibility

2013-06-02 Thread Dan Stromberg
From http://stromberg.dnsalias.org/~dstromberg/Intro-to-Python/Python%202%20and%203.pdf: Try/Except: both 2.x and 3.x try: print(1/0) except ZeroDivisionError: extra = sys.exc_info()[1] print('oops') HTH On Sun, Jun 2, 2013 at 7:13 AM, Jason Swails wrote: > Hello Everyone, > > I ha