SCons / bin /

Diff from to


 import sys
 import tempfile
 import time
-import urllib
 import zipfile
+    # try Python 3.x style
+    from urllib.request import urlretrieve
+except ImportError:
+    # nope, must be 2.x; this hack is equivalent
+    import imp
+    # protect import from fixer
+    urlretrieve = imp.load_module('urllib',
+                                  *imp.find_module('urllib')).urlretrieve
 helpstr = """\
 Usage: [-f zipfile] [-o outdir] [-v] [--xml] [runtest arguments]
 # Fetch the input file if it happens to be across a network somewhere.
 # Ohmigod, does Python make this simple...
-inputfile, headers = urllib.urlretrieve(inputfile)
+inputfile, headers = urlretrieve(inputfile)
 # Unzip the header file in the output directory.  We use our own code
 # (lifted from to make the output subdirectory name