tobegit3hub / advisor

Open-source implementation of Google Vizier for hyper parameters tuning
https://advisor.readthedocs.io
Apache License 2.0
1.54k stars 257 forks source link

[ Bug? ] Syntax error in admin_command.py #20

Closed mlaradji closed 5 years ago

mlaradji commented 5 years ago

System Information

OS: Ubuntu 18.04.1 running in an LXD container LXD: 3.6 (snap) conda: 4.5.11 Python: 3.7.0.final.0 advisor: 0.1.6

Issue

I have installed advisor through pip on a fresh Python 3.7 miniconda installation. Running advisor_admin server start results in the following error:

Traceback (most recent call last):
  File "/home/ubuntu/.conda/envs/ubuntu/bin/advisor_admin", line 7, in <module>
    from advisor_client.commandline.admin_command import main
  File "/home/ubuntu/.conda/envs/ubuntu/lib/python3.7/site-packages/advisor_client/commandline/admin_command.py", line 110
    except subprocess.CalledProcessError, e:
                                        ^
SyntaxError: invalid syntax

Fix

The error can be resolved by simply changing the following line in admin_command.py:

    except subprocess.CalledProcessError, e:

to

    except subprocess.CalledProcessError as e:

After that change, advisor_admin server start runs on my system without errors.

Note that as is not supported in Python versions below 2.5 (according to an answer in https://stackoverflow.com/questions/2535760/python-try-except-comma-vs-as-in-except).

Pull Request

Note that I have created a pull request for the proposed change.

tobegit3hub commented 5 years ago

Resolved by https://github.com/tobegit3hub/advisor/pull/21 .