#2910·taipy

`Gui.__exit__` 无条件返回 `True`, 非法地捕获 `with state:` 和 `with gui:` 中的所有异常

作者: codeCraft-Ritik创建于 2026年9月22日更新于 2026年9月22日

taipy/gui/gui.py lines 1554-1562

def exit(self, exc_type, exc_value, traceback): try: self.__send_messages() except Exception as e: # pragma: no cover _warn("Exception raised while sending messages", e) if exc_value: # pragma: no cover _warn(f"An {exc_type or 'Exception'} was raised", exc_value) return True # <--- CRITICAL BUG: Suppresses any exception in 'with state:'!

taipy/gui/state.py lines 154-155

with state: state.var_a = 1 state.var_b = 2