Commit f7d5398c authored by Godefroid Chapelle's avatar Godefroid Chapelle

Tune dev.py

parent 9d5f6f2c
...@@ -118,15 +118,8 @@ def main(args): ...@@ -118,15 +118,8 @@ def main(args):
print(output.decode('utf8')) print(output.decode('utf8'))
return not was_up_to_date return not was_up_to_date
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
# some debian/ubuntu based machines print(e.output)
# have broken pip installs raise RuntimeError("Upgrade of %s failed." % package)
# that cannot import distutils or html5lib
# thus try to install via get-pip
if (b"ImportError" in e.output or
b"ModuleNotFoundError" in e.output) :
install_pip()
return False
raise RuntimeError("Upgrade %s failed." % package)
def install_pinned_version(package, version): def install_pinned_version(package, version):
print('') print('')
...@@ -145,15 +138,10 @@ def main(args): ...@@ -145,15 +138,10 @@ def main(args):
print(output.decode('utf8')) print(output.decode('utf8'))
return not was_up_to_date return not was_up_to_date
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
# some debian/ubuntu based machines print(e.output)
# have broken pip installs raise RuntimeError(
# that cannot import distutils or html5lib "Install version %s of %s failed." % (version, package)
# thus try to install via get-pip )
if (b"ImportError" in e.output or
b"ModuleNotFoundError" in e.output) :
install_pip()
return False
raise RuntimeError("Install %s failed." % package)
def show(package): def show(package):
try: try:
...@@ -165,7 +153,7 @@ def main(args): ...@@ -165,7 +153,7 @@ def main(args):
if line.startswith(b'Name') or line.startswith(b'Version'): if line.startswith(b'Name') or line.startswith(b'Version'):
print(line.decode('utf8')) print(line.decode('utf8'))
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
raise RuntimeError("Upgrade %s failed." % package) raise RuntimeError("Show version of %s failed." % package)
need_restart = False need_restart = False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment