diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2020-06-16 13:51:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 08:51:47 -0400 |
commit | a3f11567d930b7da0db068c3b313f6f4abbf12a1 (patch) | |
tree | ee9f7b2e8a8e088b4f745f07d79867ad2b163211 /synapse/rest/client/v2_alpha/report_event.py | |
parent | Convert the device message and pagination handlers to async/await. (#7678) (diff) | |
download | synapse-a3f11567d930b7da0db068c3b313f6f4abbf12a1.tar.xz |
Replace all remaining six usage with native Python 3 equivalents (#7704)
Diffstat (limited to 'synapse/rest/client/v2_alpha/report_event.py')
-rw-r--r-- | synapse/rest/client/v2_alpha/report_event.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/synapse/rest/client/v2_alpha/report_event.py b/synapse/rest/client/v2_alpha/report_event.py index f067b5edac..e15927c4ea 100644 --- a/synapse/rest/client/v2_alpha/report_event.py +++ b/synapse/rest/client/v2_alpha/report_event.py @@ -14,9 +14,7 @@ # limitations under the License. import logging - -from six import string_types -from six.moves import http_client +from http import HTTPStatus from synapse.api.errors import Codes, SynapseError from synapse.http.servlet import ( @@ -47,15 +45,15 @@ class ReportEventRestServlet(RestServlet): body = parse_json_object_from_request(request) assert_params_in_dict(body, ("reason", "score")) - if not isinstance(body["reason"], string_types): + if not isinstance(body["reason"], str): raise SynapseError( - http_client.BAD_REQUEST, + HTTPStatus.BAD_REQUEST, "Param 'reason' must be a string", Codes.BAD_JSON, ) if not isinstance(body["score"], int): raise SynapseError( - http_client.BAD_REQUEST, + HTTPStatus.BAD_REQUEST, "Param 'score' must be an integer", Codes.BAD_JSON, ) |