From 062ecec846c2bb6bfeb0f28399dbe0f81e0c8815 Mon Sep 17 00:00:00 2001 From: Mesalu Date: Mon, 3 Oct 2016 13:34:18 -0700 Subject: [PATCH] Added check for mgr in close procedure Added to resolve the following error: Traceback (most recent call last): File "/users/dunnsa/lib/python3.5/site-packages/wx/lib/inspection.py", line 278, in OnClose self.SaveSettings(self.config) File "/users/dunnsa/lib/python3.5/site-packages/wx/lib/inspection.py", line 431, in SaveSettings perspective = self.mgr.SavePerspective() AttributeError: 'InspectionFrame' object has no attribute 'mgr' Still not sure why this happening, and I'm more inclined to believe it a fault in my TLW's close process. However it has happened on two different machines (both wxGTK) under a normal user close event. --- wx/lib/inspection.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wx/lib/inspection.py b/wx/lib/inspection.py index c560e801..6ffb4668 100644 --- a/wx/lib/inspection.py +++ b/wx/lib/inspection.py @@ -427,10 +427,11 @@ class InspectionFrame(wx.Frame): px, py = self.GetPosition() config.WriteInt('Window/PosX', px) config.WriteInt('Window/PosY', py) - - perspective = self.mgr.SavePerspective() - config.Write('perspective', perspective) - config.WriteBool('includeSizers', self.includeSizers) + + if hasattr(self, "mgr"): + perspective = self.mgr.SavePerspective() + config.Write('perspective', perspective) + config.WriteBool('includeSizers', self.includeSizers) #---------------------------------------------------------------------------