summaryrefslogtreecommitdiff
path: root/bin/install_scons.py
diff options
context:
space:
mode:
authorStefan Zimmermann <zimmermann.code@gmail.com>2014-03-31 15:13:02 +0000
committerStefan Zimmermann <zimmermann.code@gmail.com>2014-03-31 15:13:02 +0000
commit15ad84e7cd33f33d287c63d6e00a221d859cce3b (patch)
tree4464eb544fe0cc698ea4d1c5789e19770b83cd6f /bin/install_scons.py
parent9d3a9c2cc0187294500ea8018a7ffcc1c7b67037 (diff)
downloadscons-15ad84e7cd33f33d287c63d6e00a221d859cce3b.tar.gz
Made former 2to3 changes Python 2.7 compatible (or removed unneeded changes).
Diffstat (limited to 'bin/install_scons.py')
-rw-r--r--bin/install_scons.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/install_scons.py b/bin/install_scons.py
index b732193f..7a39e963 100644
--- a/bin/install_scons.py
+++ b/bin/install_scons.py
@@ -17,13 +17,17 @@
# This was written for a Linux system (specifically Ubuntu) but should
# be reasonably generic to any POSIX-style system with a /usr/local
# hierarchy.
+from __future__ import print_function
import getopt
import os
import shutil
import sys
import tarfile
-import urllib.request, urllib.parse, urllib.error
+try:
+ from urllib.request import urlretrieve
+except ImportError: # Python < 3
+ from urllib import urlretrieve
from Command import CommandRunner, Usage
@@ -171,7 +175,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
if not os.path.exists(tar_gz):
if not os.path.exists(downloads_dir):
cmd.run('mkdir %(downloads_dir)s')
- cmd.run((urllib.request.urlretrieve, tar_gz_url, tar_gz),
+ cmd.run((urlretrieve, tar_gz_url, tar_gz),
'wget -O %(tar_gz)s %(tar_gz_url)s')
def extract(tar_gz):