我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用wx.PyDeadObjectError()。
def terminate(self): try: gui.mainFrame.sysTrayIcon.preferencesMenu.RemoveItem(self.ocrSettingsItem) except wx.PyDeadObjectError: pass
def terminate(self): super(GlobalPlugin, self).terminate() try: self.prefsMenu.RemoveItem(self.w10Settings) except (RuntimeError, AttributeError, wx.PyDeadObjectError): pass if w10config.updateChecker and w10config.updateChecker.IsRunning(): w10config.updateChecker.Stop() w10config.updateChecker = None
def _Refresh(self, *elements): """Call Editor refresh functions. :param elements: List of elements to refresh. """ try: for element in elements: self.RefreshFunctions[element]() except wx.PyDeadObjectError: # ignore exceptions caused by refresh while quitting pass
def terminate(self): super(AppModule, self).terminate() try: self.preferencesMenu.RemoveItem(self.settingsItem) except wx.PyDeadObjectError: pass
def quit(self): try: self.gui.on_close('event') except wx.PyDeadObjectError: pass os._exit(0)
def terminate(): global masterDLL if masterDLL is not None: masterDLL.DBMaster_Stop() masterDLL = None try: gui.mainFrame.sysTrayIcon.toolsMenu.Remove(gui.mainFrame.sysTrayIcon.toolsMenu.MenuItems.index(installMenuItem)) except wx.PyDeadObjectError: pass