diff --git a/synapse/events/presence_router.py b/synapse/events/presence_router.py index 9942a5508351..a8e4f676da98 100644 --- a/synapse/events/presence_router.py +++ b/synapse/events/presence_router.py @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import TYPE_CHECKING, Dict, Iterable, Literal, Set, Union +from typing import TYPE_CHECKING, Dict, Iterable, Set, Union + +from typing_extensions import Literal from synapse.handlers.presence import UserPresenceState diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index ac45e056bd3f..e43cf64d85a4 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -31,7 +31,6 @@ FrozenSet, Iterable, List, - Literal, Optional, Set, Tuple, @@ -39,7 +38,7 @@ ) from prometheus_client import Counter -from typing_extensions import ContextManager +from typing_extensions import ContextManager, Literal import synapse.metrics from synapse.api.constants import EventTypes, Membership, PresenceState diff --git a/tests/events/test_presence_router.py b/tests/events/test_presence_router.py index b434db018eb1..9ff0800d7747 100644 --- a/tests/events/test_presence_router.py +++ b/tests/events/test_presence_router.py @@ -12,9 +12,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import Dict, Iterable, List, Literal, Optional, Set, Union +from typing import Dict, Iterable, List, Optional, Set, Union import attr +from typing_extensions import Literal from synapse.handlers.presence import UserPresenceState from synapse.module_api import ModuleApi