aboutsummaryrefslogtreecommitdiff
path: root/samplejobs/BWAuthChecker.py
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2020-09-07 23:54:47 -0400
committerTom Ritter <tom@ritter.vg>2020-09-07 23:54:47 -0400
commit7deaed5205d0db6139f1c5e1f7c2b72181b1a208 (patch)
treea9f11fe72bf4b20d787bd90bbcb7a78902dac1ae /samplejobs/BWAuthChecker.py
parent4671e0dec5eab28941e598f109dbf77ed551a707 (diff)
Run futurize on the codebase for python3
Diffstat (limited to 'samplejobs/BWAuthChecker.py')
-rwxr-xr-xsamplejobs/BWAuthChecker.py5
1 files changed, 4 insertions, 1 deletions
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: