diff --git a/sdk/core/azure-core/HISTORY.md b/sdk/core/azure-core/HISTORY.md index e0303b390a26..cdd652db7691 100644 --- a/sdk/core/azure-core/HISTORY.md +++ b/sdk/core/azure-core/HISTORY.md @@ -9,7 +9,12 @@ - Support fixed retry #6419 - Support "retry-after-ms" in response header #9240 -## 1.1.1 (2019-12-03) +### Bug fixes + +- Removed `__enter__` and `__exit__` from async context managers +([#9313](https://github.com/Azure/azure-sdk-for-python/pull/9313)) + +## 1.1.1 (2019-12-03) ### Bug fixes diff --git a/sdk/core/azure-core/azure/core/pipeline/_base_async.py b/sdk/core/azure-core/azure/core/pipeline/_base_async.py index 64b6e7608083..d58ed8292bc6 100644 --- a/sdk/core/azure-core/azure/core/pipeline/_base_async.py +++ b/sdk/core/azure-core/azure/core/pipeline/_base_async.py @@ -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 diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py b/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py index 80cc9073d27b..4f38d87ca103 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/_base_async.py @@ -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