On 04/04/2013 03:52 AM, Don Zickus wrote:
Ha!  I spent a few minutes converting them to 'as e' yesterday.  I was
sure if the old way was still supported.  I'll gladly convert them back.

2.6 and 2.7 support both forms, 3.x only supports the new unambiguous syntax ("expect SomeException as exc"). To support both 2.5 or earlier *and* 3.x in the same code base you have to use sys.exc_info() rather than the syntactic support for binding the caught exception to a name:

    except SomeException:
        exc_type, exc, exc_tb = sys.exc_info()

Cheers,
Nick.

--
Nick Coghlan
Red Hat Infrastructure Engineering & Development, Brisbane

Python Applications Team Lead
Beaker Development Lead (http://beaker-project.org/)
PulpDist Development Lead (http://pulpdist.readthedocs.org)

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to