X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7993762b11cb07b74c6f6de483523881dea95482..c0b49f7fffbd1cecb9c67b578db62d84bd8c8ff8:/wxPython/src/mac/_core.py diff --git a/wxPython/src/mac/_core.py b/wxPython/src/mac/_core.py index ceb9755a86..6d9ccebf87 100644 --- a/wxPython/src/mac/_core.py +++ b/wxPython/src/mac/_core.py @@ -5691,11 +5691,9 @@ your Mac.""" self._BootstrapApp() - def __del__(self): - try: - self.RestoreStdio() # Just in case the MainLoop was overridden - finally: - wx.PyApp.__del__(self) + def __del__(self, destroy=wx.PyApp.__del__): + self.RestoreStdio() # Just in case the MainLoop was overridden + destroy(self) def Destroy(self): wx.PyApp.Destroy(self) @@ -5724,7 +5722,10 @@ your Mac.""" def RestoreStdio(self): - _sys.stdout, _sys.stderr = self.saveStdio + try: + _sys.stdout, _sys.stderr = self.saveStdio + except: + pass def SetOutputWindowAttributes(self, title=None, pos=None, size=None):