Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Import Literal from typing_extensions instead
Browse files Browse the repository at this point in the history
We can't import it from typing until Py3.8.
  • Loading branch information
anoadragon453 committed Mar 17, 2021
1 parent b1709e9 commit d013bf9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion synapse/events/presence_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
FrozenSet,
Iterable,
List,
Literal,
Optional,
Set,
Tuple,
Union,
)

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
Expand Down
3 changes: 2 additions & 1 deletion tests/events/test_presence_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d013bf9

Please sign in to comment.