Skip to content

Commit 3e3203f

Browse files
committed
Fix for python3
1 parent f61a50f commit 3e3203f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bot/osmbot_blueprint.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from bot.osmbot import OsmBot
1212
from telegram import Bot as TBot
1313
from telegram import error
14+
import sys
1415

1516
application = Flask(__name__)
1617
application.debug = True
@@ -91,8 +92,13 @@ def attend_webhook(token):
9192
except error.Unauthorized:
9293
return 'OK'
9394
except Exception as e:
94-
if e.message == 'Unauthorized':
95-
return 'OK'
95+
if sys.version_info.major ==2:
96+
if e.message == 'Unauthorized':
97+
return 'OK'
98+
else:
99+
if str(e) == 'Unauthorized':
100+
return 'OK'
101+
96102
print(str(e))
97103
import traceback
98104
traceback.print_exc()

0 commit comments

Comments
 (0)