From 7deaed5205d0db6139f1c5e1f7c2b72181b1a208 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Mon, 7 Sep 2020 23:54:47 -0400 Subject: Run futurize on the codebase for python3 --- samplejobs/BWAuthChecker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'samplejobs/BWAuthChecker.py') diff --git a/samplejobs/BWAuthChecker.py b/samplejobs/BWAuthChecker.py index 618075e..ff59516 100755 --- a/samplejobs/BWAuthChecker.py +++ b/samplejobs/BWAuthChecker.py @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import division +from builtins import str +from past.utils import old_div import os import re import time @@ -29,7 +32,7 @@ class BWAuthChecker(JobBase.JobBase): now = datetime.datetime.utcfromtimestamp(time.time()) if now - then > datetime.timedelta(hours=4): body = "The bandwidth file is more than 4 hours old.\n" - body += str((now-then).seconds / 60) + " minutes old.\n" + body += str(old_div((now-then).seconds, 60)) + " minutes old.\n" elif len(lines) < 8300: body = "The bandwidth file has a low number of relays: " + str(len(lines)) + "\n" except Exception as e: -- cgit v1.2.3