diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-09-28 12:19:30 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-09-28 12:19:30 +0200 |
commit | 7c6dd0eee627772485f8b06470ac84adc0f077f6 (patch) | |
tree | 69a28021c01029c221f78be31c4cb0335922ebfe /bin/install_scons.py | |
parent | 6be31f5d140b81227911cabfc61d3802c76c1b61 (diff) | |
parent | baee03c569c91b745a1e025660b19a718db16e7d (diff) |
Updated version 3.0.0 from 'upstream/3.0.0'
with Debian dir 147caafe8506326dfd094432b42ae32c21ed284e
Diffstat (limited to 'bin/install_scons.py')
-rw-r--r-- | bin/install_scons.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/install_scons.py b/bin/install_scons.py index 00129f6..ac79fd3 100644 --- a/bin/install_scons.py +++ b/bin/install_scons.py @@ -18,12 +18,14 @@ # 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 +from urllib import urlretrieve from Command import CommandRunner, Usage @@ -129,7 +131,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...] try: try: opts, args = getopt.getopt(argv[1:], short_options, long_options) - except getopt.error, msg: + except getopt.error as msg: raise Usage(msg) for o, a in opts: @@ -138,7 +140,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...] elif o in ('-d', '--downloads'): downloads_dir = a elif o in ('-h', '--help'): - print helpstr + print(helpstr) sys.exit(0) elif o in ('-n', '--no-exec'): CommandRunner.execute = CommandRunner.do_not_execute @@ -146,7 +148,7 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...] prefix = a elif o in ('-q', '--quiet'): CommandRunner.display = CommandRunner.do_not_display - except Usage, err: + except Usage as err: sys.stderr.write(str(err.msg) + '\n') sys.stderr.write('use -h to get help\n') return 2 @@ -171,7 +173,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.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): |