X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/578b389d6ec025acc887d4648df20a366f43882d..68ff6404bb8ea57371214a6c8a416cf8a4a31453:/wxPython/wx/py/editor.py?ds=sidebyside diff --git a/wxPython/wx/py/editor.py b/wxPython/wx/py/editor.py index 6a6293ca22..671ede9e0b 100644 --- a/wxPython/wx/py/editor.py +++ b/wxPython/wx/py/editor.py @@ -607,15 +607,18 @@ class Editor: def getStatus(self): """Return (filepath, line, column) status tuple.""" - pos = self.window.GetCurrentPos() - line = self.window.LineFromPosition(pos) + 1 - col = self.window.GetColumn(pos) - if self.buffer: - name = self.buffer.doc.filepath or self.buffer.name + if self.window: + pos = self.window.GetCurrentPos() + line = self.window.LineFromPosition(pos) + 1 + col = self.window.GetColumn(pos) + if self.buffer: + name = self.buffer.doc.filepath or self.buffer.name + else: + name = '' + status = (name, line, col) + return status else: - name = '' - status = (name, line, col) - return status + return ('', 0, 0) def getText(self): """Return contents of editor."""