changeset 33:7d8bee5e3c80

Retain backwards compatibility with 2.7
author Daniel O'Connor <darius@dons.net.au>
date Sat, 14 Nov 2020 14:56:05 +1030
parents 1af6865189ce
children b79c03810bbe
files adslstats.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/adslstats.py	Sat Nov 14 14:54:05 2020 +1030
+++ b/adslstats.py	Sat Nov 14 14:56:05 2020 +1030
@@ -33,7 +33,10 @@
 import base64
 import binascii
 import bs4
-import configparser
+try:
+    import configparser
+except ImportError:
+    import ConfigParser as configparser
 import json
 import mechanize
 import mysrp as srp
@@ -45,7 +48,7 @@
 import rrdtool
 import sys
 import time
-import urllib.request, urllib.parse, urllib.error
+import urllib
 from functools import reduce
 
 conf = configparser.ConfigParser()