[Neurodebian-users] Problem with python-joblib package (0.6.0~b2-1~nd60+1) on debian squeeze

Andrew Davison andrewpdavison at gmail.com
Fri Jan 13 08:38:27 UTC 2012


Hi Gael,

On 12 janv. 2012, at 18:35, Gael Varoquaux wrote:
> I'll have to think a bit more about how to integrate them: the 'except
> Exception as e' is required for Python 3, in which the 'expect Exception,
> e' will not work, I believe.

The idiom I've seen suggested for this is:

import sys
try:
    some_code()
except Exception:
    e = sys.exc_info()[1]

which works in both Python 2 and Python 3 (from http://python3porting.com/differences.html), although it's not terribly elegant.

Cheers,

Andrew




More information about the Neurodebian-users mailing list