Fixed "AttributeError: datetime.timedelta object has no attribute total_seconds" for Python 2.6