From 8ce2e3149a756122be1f5d948ba1bd11266dd9ef Mon Sep 17 00:00:00 2001 From: j Date: Tue, 18 Sep 2018 10:33:11 +0200 Subject: [PATCH] python2 print does not support end= --- ox/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ox/api.py b/ox/api.py index da0d5ab..2cbc641 100644 --- a/ox/api.py +++ b/ox/api.py @@ -183,7 +183,10 @@ class API(object): print("\ninterrupted by user.") sys.exit(1) except: - print("uploading chunk failed, will try again in 5 seconds\r", end='') + try: + print("uploading chunk failed, will try again in 5 seconds\r", end='') + except: + print("uploading chunk failed, will try again in 5 seconds\r") sys.stdout.flush() data = {'result': -1} time.sleep(5)