Catch AttributeError to manage python <2.6