Only patch sarge's async on python 2

This commit is contained in:
Gina Häußge committed 2018-11-22 13:10:59 +01:00
1 parent db8d420860
commit ac129a2576
2 files changed
+7 -3

No files matched your search

+2 -2
View File
@@ -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")
+5 -1
View File
@@ -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):