diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/scons-test.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bin/scons-test.py b/bin/scons-test.py index 0089e24..2191532 100644 --- a/bin/scons-test.py +++ b/bin/scons-test.py @@ -22,9 +22,18 @@ import os.path import sys import tempfile import time -import urllib import zipfile +try: + # 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: scons-test.py [-f zipfile] [-o outdir] [-v] [--xml] [runtest arguments] Options: @@ -69,7 +78,7 @@ if not os.path.exists(tempdir): # 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 scons-unzip.py) to make the output subdirectory name |