Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def closeEvent(self, event):
if self.tabs.widget(1).should_exit():
Application.instance().windows.discard(self)
event.accept()
else:
event.ignore()