summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-08-03 16:15:34 -0700
committerAndrew Morgan <andrew@amorgan.xyz>2020-08-03 16:15:34 -0700
commit48e7f210c6655b83a2f719acb7f41cf0fece10a1 (patch)
tree961b66bdd6b432bc8af4f8519e4fce81bd2f4863 /synapse/api
parentMerge commit '98c4e35e3' into dinsic (diff)
parentReplace all remaining six usage with native Python 3 equivalents (#7704) (diff)
downloadsynapse-48e7f210c6655b83a2f719acb7f41cf0fece10a1.tar.xz
Merge commit 'a3f11567d' into dinsic
* commit 'a3f11567d':
  Replace all remaining six usage with native Python 3 equivalents (#7704)
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/errors.py7
-rw-r--r--synapse/api/filtering.py4
-rw-r--r--synapse/api/urls.py3
3 files changed, 5 insertions, 9 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py

index 367330fd91..20aff11c81 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py
@@ -18,10 +18,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 @@ -181,7 +180,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 @@ -201,7 +200,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 ) diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py
index 8b64d0a285..f988f62a1e 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py
@@ -17,8 +17,6 @@ # limitations under the License. from typing import List -from six import text_type - import jsonschema from canonicaljson import json from jsonschema import FormatChecker @@ -313,7 +311,7 @@ class Filter(object): content = event.get("content", {}) # check if there is a string url field in the content for filtering purposes - contains_url = isinstance(content.get("url"), text_type) + contains_url = isinstance(content.get("url"), str) labels = content.get(EventContentFields.LABELS, []) return self.check_fields(room_id, sender, ev_type, labels, contains_url) diff --git a/synapse/api/urls.py b/synapse/api/urls.py
index f34434bd67..bd03ebca5a 100644 --- a/synapse/api/urls.py +++ b/synapse/api/urls.py
@@ -17,8 +17,7 @@ """Contains the URL paths to prefix various aspects of the server with. """ import hmac from hashlib import sha256 - -from six.moves.urllib.parse import urlencode +from urllib.parse import urlencode from synapse.config import ConfigError