hasattr check in scipy version