diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index b4ed1468b..48cf8f25c 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -595,8 +595,8 @@ def main(): # cut off stuff from the beginning args = args[-1 * sys_args_length:] if sys_args_length else [] - from octoprint.util.fixes import fix_sarge_async - fix_sarge_async() + from octoprint.util.fixes import patch_sarge_async_on_py2 + patch_sarge_async_on_py2() from octoprint.cli import octo octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT") diff --git a/src/octoprint/util/fixes.py b/src/octoprint/util/fixes.py index e5ea56af8..8ea63d8d3 100644 --- a/src/octoprint/util/fixes.py +++ b/src/octoprint/util/fixes.py @@ -7,8 +7,12 @@ __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agp import functools import warnings +import sys + +def patch_sarge_async_on_py2(): + if sys.version_info[0] >= 3: + return -def fix_sarge_async(): def move_async(f): @functools.wraps(f) def decorated_function(*args, **kwargs):