summary refs log tree commit diff
path: root/synapse/api/errors.py
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-06-16 13:51:47 +0100
committerGitHub <noreply@github.com>2020-06-16 08:51:47 -0400
commita3f11567d930b7da0db068c3b313f6f4abbf12a1 (patch)
treeee9f7b2e8a8e088b4f745f07d79867ad2b163211 /synapse/api/errors.py
parentConvert the device message and pagination handlers to async/await. (#7678) (diff)
downloadsynapse-a3f11567d930b7da0db068c3b313f6f4abbf12a1.tar.xz
Replace all remaining six usage with native Python 3 equivalents (#7704)
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r--synapse/api/errors.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index a07a54580d..5305038c21 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -17,10 +17,9 @@
 """Contains exceptions and error codes."""
 
 import logging
+from http import HTTPStatus
 from typing import Dict, List
 
-from six.moves import http_client
-
 from canonicaljson import json
 
 from twisted.web import http
@@ -173,7 +172,7 @@ class ConsentNotGivenError(SynapseError):
             consent_url (str): The URL where the user can give their consent
         """
         super(ConsentNotGivenError, self).__init__(
-            code=http_client.FORBIDDEN, msg=msg, errcode=Codes.CONSENT_NOT_GIVEN
+            code=HTTPStatus.FORBIDDEN, msg=msg, errcode=Codes.CONSENT_NOT_GIVEN
         )
         self._consent_uri = consent_uri
 
@@ -193,7 +192,7 @@ class UserDeactivatedError(SynapseError):
             msg (str): The human-readable error message
         """
         super(UserDeactivatedError, self).__init__(
-            code=http_client.FORBIDDEN, msg=msg, errcode=Codes.USER_DEACTIVATED
+            code=HTTPStatus.FORBIDDEN, msg=msg, errcode=Codes.USER_DEACTIVATED
         )