Use timedelta.total_seconds() to fetch seconds in uptime segment

Closes #143.
This commit is contained in:
Kim Silkebækken 2013-01-29 11:57:31 +01:00
parent 59c316cb34
commit b918057c40
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ def uptime(format='{days:02d}d {hours:02d}h {minutes:02d}m'):
try:
import psutil
from datetime import datetime
seconds = (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)).seconds
seconds = int((datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)).total_seconds())
except ImportError:
try:
with open('/proc/uptime', 'r') as f: