diff --git a/src/aiofiles/base.py b/src/aiofiles/base.py index 410c057..35b26d2 100644 --- a/src/aiofiles/base.py +++ b/src/aiofiles/base.py @@ -23,7 +23,7 @@ def __repr__(self): async def __anext__(self): """Simulate normal file iteration.""" - if (line := await self.readline()): + if line := await self.readline(): return line raise StopAsyncIteration @@ -62,10 +62,6 @@ async def __aenter__(self): async def __aexit__(self, exc_type, exc_val, exc_tb): await get_running_loop().run_in_executor( - None, - self._obj._file.__exit__, - exc_type, - exc_val, - exc_tb, + None, self._obj._file.__exit__, exc_type, exc_val, exc_tb ) self._obj = None