Import functools with fallback for py24