From acf87c0b09bbb13078e7a37c99137c4af2fee66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tin=20Tvrtkovi=C4=87?= Date: Thu, 26 Aug 2021 02:57:10 +0200 Subject: [PATCH] Restore variable name --- src/aiodynamo/client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/aiodynamo/client.py b/src/aiodynamo/client.py index 98a4a76..6ee02f0 100644 --- a/src/aiodynamo/client.py +++ b/src/aiodynamo/client.py @@ -913,17 +913,19 @@ async def _depaginate( is_count = payload.get("Select") == "COUNT" try: while task: - res = await task + result = await task try: payload = { **payload, - "ExclusiveStartKey": res["LastEvaluatedKey"], + "ExclusiveStartKey": result["LastEvaluatedKey"], } except KeyError: task = None else: if limit is not None: - consumed: int = res["Count"] if is_count else len(res["Items"]) + consumed: int = ( + result["Count"] if is_count else len(result["Items"]) + ) limit -= consumed if limit > 0: payload["Limit"] = limit @@ -933,7 +935,7 @@ async def _depaginate( task = asyncio.create_task( self.send_request(action=action, payload=payload) ) - yield res + yield result except asyncio.CancelledError: if task: task.cancel()