Use trio.lowlevel instead of trio.hazmat

Since trio 0.15.0, hazmat has been deprecated.

trio-typing and mypy are bumped to support newer trio and each other.
This commit is contained in:
Nguyễn Gia Phong
2021-02-23 22:02:34 +07:00
parent 12786f4e26
commit 080f8edc8e
11 changed files with 27 additions and 29 deletions

View File

@ -297,7 +297,7 @@ class DummyRouter(IPeerRouting):
self._routing_table[peer_id] = PeerInfo(peer_id, addrs)
async def find_peer(self, peer_id: ID) -> PeerInfo:
await trio.hazmat.checkpoint()
await trio.lowlevel.checkpoint()
return self._routing_table.get(peer_id, None)

View File

@ -217,7 +217,7 @@ async def perform_test_from_obj(obj, pubsub_factory) -> None:
# Avoid repeated works
if topic in queues_map[node_id]:
# Checkpoint
await trio.hazmat.checkpoint()
await trio.lowlevel.checkpoint()
return
sub = await pubsub_map[node_id].subscribe(topic)
queues_map[node_id][topic] = sub