From bccd4af1ff4259cbe92f0a3b663ca67c09dc645e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 11 May 2022 11:17:16 +0100 Subject: [PATCH] stop possibility of infinite recursion in stages which set "stage = self" --- src/nmutil/stageapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nmutil/stageapi.py b/src/nmutil/stageapi.py index 01fc568..a34dc7e 100644 --- a/src/nmutil/stageapi.py +++ b/src/nmutil/stageapi.py @@ -197,7 +197,8 @@ class StageHelper(Stage): def setup(self, m, i): if self.stage is not None and hasattr(self.stage, "setup"): - self.stage.setup(m, i) + if self.stage is not self: # stop infinite recursion + self.stage.setup(m, i) def _postprocess(self, i): # XXX DISABLED return i # RETURNS INPUT -- 2.30.2