Use HTTPStatus instead of http.client

Status in http.client is deprecated since 3.5
This commit is contained in:
Cédric Krier committed 2021-11-23 16:24:44 +01:00
1 parent 5d802989aa
commit 357dfd9286
1 file changed
+1 -2
+1 -2
View File
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import http.client
import logging
import pydoc
import time
@@ -155,7 +154,7 @@ def _dispatch(request, pool, *args, **kwargs):
context = {'_request': request.context}
if not security.check_timeout(
pool.database_name, user, session, context=context):
abort(http.client.UNAUTHORIZED)
abort(HTTPStatus.UNAUTHORIZED)
log_message = '%s.%s(*%s, **%s) from %s@%s%s'
username = request.authorization.username