fix to compatible with Python2.6

total_seconds() method only for Python2.7 or later, so I change it to compatible with Python2.6.
Merge pull request #540 from cyy5121212/master

fix to compatible with Python2.6