Replace all remaining six usage with native Python 3 equivalents (#7704)

This commit is contained in:
Dagfinn Ilmari Mannsåker 2020-06-16 13:51:47 +01:00 committed by GitHub
parent 98c4e35e3c
commit a3f11567d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 111 additions and 237 deletions

View file

@ -17,10 +17,9 @@
import abc
import logging
from http import HTTPStatus
from typing import Dict, Iterable, List, Optional, Tuple
from six.moves import http_client
from synapse import types
from synapse.api.constants import EventTypes, Membership
from synapse.api.errors import AuthError, Codes, SynapseError
@ -361,7 +360,7 @@ class RoomMemberHandler(object):
if effective_membership_state == Membership.INVITE:
# block any attempts to invite the server notices mxid
if target.to_string() == self._server_notices_mxid:
raise SynapseError(http_client.FORBIDDEN, "Cannot invite this user")
raise SynapseError(HTTPStatus.FORBIDDEN, "Cannot invite this user")
block_invite = False
@ -444,7 +443,7 @@ class RoomMemberHandler(object):
is_blocked = await self._is_server_notice_room(room_id)
if is_blocked:
raise SynapseError(
http_client.FORBIDDEN,
HTTPStatus.FORBIDDEN,
"You cannot reject this invite",
errcode=Codes.CANNOT_LEAVE_SERVER_NOTICE_ROOM,
)