Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions distributed/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,17 +1197,6 @@ async def close_rpc(self):
self.status = Status.closed
return await asyncio.gather(*self.close_comms())

def __enter__(self):
warnings.warn(
"the rpc synchronous context manager is deprecated",
DeprecationWarning,
stacklevel=2,
)
return self

def __exit__(self, exc_type, exc_value, traceback):
asyncio.ensure_future(self.close_rpc())

async def __aenter__(self):
return self

Expand Down Expand Up @@ -1266,18 +1255,6 @@ async def send_recv_from_rpc(**kwargs):
async def close_rpc(self):
pass

# For compatibility with rpc()
def __enter__(self):
warnings.warn(
"the rpc synchronous context manager is deprecated",
DeprecationWarning,
stacklevel=2,
)
return self

def __exit__(self, exc_type, exc_value, traceback):
pass

async def __aenter__(self):
return self

Expand Down
2 changes: 1 addition & 1 deletion distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ async def close( # type: ignore
setproctitle("dask worker [closing]")

if nanny and self.nanny:
with self.rpc(self.nanny) as r:
async with self.rpc(self.nanny) as r:
await r.close_gracefully(reason=reason)

# Cancel async instructions
Expand Down
Loading