From 335ec712258e45492091dc646141005748afa318 Mon Sep 17 00:00:00 2001 From: epiphyte Date: Thu, 26 Dec 2024 16:44:40 -0500 Subject: [PATCH] Fix up item references & Exception refs --- synapse/lib/ast.py | 32 ++++++++++++++++---------------- synapse/lib/stormctrl.py | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/synapse/lib/ast.py b/synapse/lib/ast.py index 667005f53d..fce190f2f3 100644 --- a/synapse/lib/ast.py +++ b/synapse/lib/ast.py @@ -1020,13 +1020,13 @@ async def run(self, runt, genr): yield item except s_stormctrl.StormBreak as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem break except s_stormctrl.StormContinue as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem continue finally: @@ -1079,13 +1079,13 @@ async def run(self, runt, genr): yield jtem except s_stormctrl.StormBreak as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem break except s_stormctrl.StormContinue as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem continue finally: @@ -1109,13 +1109,13 @@ async def run(self, runt, genr): await asyncio.sleep(0) except s_stormctrl.StormBreak as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem break except s_stormctrl.StormContinue as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem continue finally: @@ -1133,13 +1133,13 @@ async def run(self, runt, genr): await asyncio.sleep(0) except s_stormctrl.StormBreak as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem break except s_stormctrl.StormContinue as e: - if e.item is not None: - yield e.item + if (eitem := e.get('item')) is not None: + yield eitem continue finally: diff --git a/synapse/lib/stormctrl.py b/synapse/lib/stormctrl.py index 92c98c67a6..0c4aa05f29 100644 --- a/synapse/lib/stormctrl.py +++ b/synapse/lib/stormctrl.py @@ -63,11 +63,11 @@ def update(self, items): self.errinfo[k] = v self._setExcMesg() -class StormLoopCtrl(_SynErrMixin): +class StormLoopCtrl(_SynErrMixin, Exception): # Control flow statements for WHILE and FOR loop control statement = '' -class StormGenrCtrl(_SynErrMixin): +class StormGenrCtrl(_SynErrMixin, Exception): # Control flow statements for GENERATOR control statement = ''