Joblib doesn't support Python 2.5 anymore. I think that you can simplify the code here.