From cf8c76b5c60d2f45dc8bc848be0f01727b1fd46e Mon Sep 17 00:00:00 2001 From: cybermaggedon Date: Mon, 9 Dec 2024 00:01:01 +0000 Subject: [PATCH] Fix/save core hang (#201) * Working around an exception class change in Python 3.11 --- trustgraph-cli/scripts/tg-load-kg-core | 8 ++++++-- trustgraph-cli/scripts/tg-save-kg-core | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/trustgraph-cli/scripts/tg-load-kg-core b/trustgraph-cli/scripts/tg-load-kg-core index 5c2ae140..cada13a7 100755 --- a/trustgraph-cli/scripts/tg-load-kg-core +++ b/trustgraph-cli/scripts/tg-load-kg-core @@ -29,7 +29,9 @@ async def load_ge(running, queue, url): try: msg = await asyncio.wait_for(queue.get(), 1) - except TimeoutError: + except: + # Hopefully it's TimeoutError. Annoying to match since + # it changed in 3.11. continue msg = { @@ -55,7 +57,9 @@ async def load_triples(running, queue, url): try: msg = await asyncio.wait_for(queue.get(), 1) - except TimeoutError: + except: + # Hopefully it's TimeoutError. Annoying to match since + # it changed in 3.11. continue msg ={ diff --git a/trustgraph-cli/scripts/tg-save-kg-core b/trustgraph-cli/scripts/tg-save-kg-core index f2509dba..e52cd7dc 100755 --- a/trustgraph-cli/scripts/tg-save-kg-core +++ b/trustgraph-cli/scripts/tg-save-kg-core @@ -133,7 +133,9 @@ async def output(running, queue, path, format): try: msg = await asyncio.wait_for(queue.get(), 0.5) - except TimeoutError: + except: + # Hopefully it's TimeoutError. Annoying to match since + # it changed in 3.11. continue if format == "msgpack":