diff --git a/test/mod_wsgi_test/test_client.py b/test/mod_wsgi_test/test_client.py index 6d0e5d657..a0b1885b5 100644 --- a/test/mod_wsgi_test/test_client.py +++ b/test/mod_wsgi_test/test_client.py @@ -21,12 +21,18 @@ import time from optparse import OptionParser -from bson.py3compat import PY3, thread - -if PY3: - from urllib.request import urlopen -else: +try: from urllib2 import urlopen +except ImportError: + # Python 3. + from urllib.request import urlopen + + +try: + import thread +except ImportError: + # Python 3. + import _thread as thread def parse_args():