Fix Bug: total_seconds is new in Python 2.7, use equals method to replace it