From c1523340bbdd4f91c059ea0ea3cda7665ef86d56 Mon Sep 17 00:00:00 2001 From: sph3rex Date: Fri, 23 Feb 2018 15:23:23 +0200 Subject: [PATCH] Fix urllib import --- pywait.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pywait.py b/pywait.py index c86aa4b..c5c67c2 100644 --- a/pywait.py +++ b/pywait.py @@ -5,11 +5,14 @@ import sys import time import socket -from pprint import pprint -from urllib.request import urlopen from contextlib import closing +try: + from urllib.request import urlopen +except ImportError: + from urllib2 import urlopen + def log(message): if not args.quiet: print(message)