stop possibility of infinite recursion in stages which
[nmutil.git] / src / nmutil / stageapi.py
index 01fc568b0146d2502321441619a667438d1aaa7a..a34dc7e213e784c1f1d5518e62400ce2956618fa 100644 (file)
@@ -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