diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 100dcc7d2f13..3da8217bdc40 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -8,8 +8,6 @@ ### Bugs Fixed -- Added check that enter aiohttp session only when it is not None. - ### Other Changes ## 1.29.4 (2023-09-07) diff --git a/sdk/core/azure-core/azure/core/pipeline/transport/_aiohttp.py b/sdk/core/azure-core/azure/core/pipeline/transport/_aiohttp.py index fad9905132e2..9c525533211a 100644 --- a/sdk/core/azure-core/azure/core/pipeline/transport/_aiohttp.py +++ b/sdk/core/azure-core/azure/core/pipeline/transport/_aiohttp.py @@ -124,8 +124,7 @@ async def open(self): self.session = aiohttp.ClientSession(**clientsession_kwargs) # pyright has trouble to understand that self.session is not None, since we raised at worst in the init self.session = cast(aiohttp.ClientSession, self.session) - if self.session is not None: - await self.session.__aenter__() + await self.session.__aenter__() async def close(self): """Closes the connection."""