def updateSysTrace(self):
## Install or uninstall sys.settrace handler
if not self.ui.catchNextExceptionBtn.isChecked() and not self.ui.catchAllExceptionsBtn.isChecked():
if sys.gettrace() == self.systrace:
sys.settrace(None)
return
if self.ui.onlyUncaughtCheck.isChecked():
if sys.gettrace() == self.systrace:
sys.settrace(None)
else:
if sys.gettrace() is not None and sys.gettrace() != self.systrace:
self.ui.onlyUncaughtCheck.setChecked(False)
raise Exception("sys.settrace is in use; cannot monitor for caught exceptions.")
else:
sys.settrace(self.systrace)
评论列表
文章目录