From 084263d8112d583d8628a6bcd0b7405034c4e05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 23 Mar 2016 12:35:24 +0100 Subject: [PATCH] Stay compatible to Click 5.x There could be some odd circumstances in development environments leading to an older Click version being installed during an update restart, so since it doesn't hurt as much to stay backwards compatible here, just be it. --- src/octoprint/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index e398418a..fa67ad1c 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -210,8 +210,12 @@ def main(): import sys # os args are gained differently on win32 - from click.utils import get_os_args - args = get_os_args() + try: + from click.utils import get_os_args + args = get_os_args() + except ImportError: + # for whatever reason we are running an older Click version? + args = sys.argv[1:] if len(args) >= len(sys.argv): # Now some ugly preprocessing of our arguments starts. We have a somewhat difficult situation on our hands