Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove enter and exit from async context managers #9313

Merged
merged 2 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 0 additions & 7 deletions sdk/core/azure-core/azure/core/pipeline/_base_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,6 @@ def __init__(self, transport, policies: AsyncPoliciesType = None) -> None:
if self._impl_policies:
self._impl_policies[-1].next = _AsyncTransportRunner(self._transport)

def __enter__(self):
raise TypeError("Use 'async with' instead")

def __exit__(self, exc_type, exc_val, exc_tb):
# __exit__ should exist in pair with __enter__ but never executed
pass # pragma: no cover

async def __aenter__(self) -> "AsyncPipeline":
await self._transport.__aenter__()
return self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,3 @@ async def close(self):

async def sleep(self, duration):
await asyncio.sleep(duration)

def __enter__(self):
raise TypeError("Use async with instead")

def __exit__(self, exc_type, exc_val, exc_tb):
# __exit__ should exist in pair with __enter__ but never executed
pass # pragma: no cover