Replace value attribute of HTTPStatus by int call

In Python3.4, HTTPStatus are not yet enums but just integers.

issue7945
review54471002
This commit is contained in:
Cédric Krier committed 2019-01-02 19:01:08 +01:00
1 parent c37edc62f7
commit 854898a708
1 file changed
+2 -2
+2 -2
View File
@@ -984,7 +984,7 @@ def process_exception(exception, *args, **kwargs):
return rpc_execute(*args)
else:
message(_('Concurrency Exception'), msg_type=gtk.MESSAGE_ERROR)
elif exception.faultCode == str(HTTPStatus.UNAUTHORIZED.value):
elif exception.faultCode == str(int(HTTPStatus.UNAUTHORIZED)):
from tryton.gui.main import Main
if PLOCK.acquire(False):
try:
@@ -1011,7 +1011,7 @@ class Login(object):
try:
func(parameters)
except TrytonServerError as exception:
if exception.faultCode == str(HTTPStatus.UNAUTHORIZED.value):
if exception.faultCode == str(int(HTTPStatus.UNAUTHORIZED)):
parameters.clear()
continue
if exception.faultCode != 'LoginException':