From 58b3eb56585687d7cbb32a69965a23e394912a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Thu, 18 Jun 2020 10:52:11 +0200 Subject: [PATCH 1/2] fixes for python 3.7 StopIteration https://www.python.org/dev/peps/pep-0479/ --- graphenecommon/blockchain.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/graphenecommon/blockchain.py b/graphenecommon/blockchain.py index 8896d644..4f012c03 100644 --- a/graphenecommon/blockchain.py +++ b/graphenecommon/blockchain.py @@ -156,7 +156,6 @@ def blocks(self, start=None, stop=None): start = head_block + 1 if stop and start > stop: - # raise StopIteration return # Sleep for one block @@ -285,12 +284,12 @@ def get_all_accounts(self, start="", stop="", steps=1e3, **kwargs): for account in ret: yield account[0] if account[0] == stop: - raise StopIteration + return if lastname == ret[-1][0]: - raise StopIteration + return lastname = ret[-1][0] if len(ret) < steps: - raise StopIteration + return @property def participation_rate(self): From 35789e9805119354faf8a21add48387c67213fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Thu, 18 Jun 2020 10:53:02 +0200 Subject: [PATCH 2/2] also for aio --- graphenecommon/aio/blockchain.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/graphenecommon/aio/blockchain.py b/graphenecommon/aio/blockchain.py index 8ce0d86d..be844e9f 100644 --- a/graphenecommon/aio/blockchain.py +++ b/graphenecommon/aio/blockchain.py @@ -134,7 +134,6 @@ async def blocks(self, start=None, stop=None): start = head_block + 1 if stop and start > stop: - # raise StopIteration return # Sleep for one block @@ -265,12 +264,12 @@ async def get_all_accounts(self, start="", stop="", steps=1e3, **kwargs): for account in ret: yield account[0] if account[0] == stop: - raise StopIteration + return if lastname == ret[-1][0]: - raise StopIteration + return lastname = ret[-1][0] if len(ret) < steps: - raise StopIteration + return @property async def participation_rate(self):