]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Amazing. A very subtle change in policy in descr-branch actually
authorGuido van Rossum <guido@python.org>
Fri, 6 Jul 2001 20:26:31 +0000 (20:26 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 6 Jul 2001 20:26:31 +0000 (20:26 +0000)
found a bug here.  Here's the deal:

Class PyShell derives from class OutputWindow.  Method PyShell.close()
wants to invoke its parent method, but because PyShell long ago was
inherited from class PyShellEditorWindow, it invokes
PyShelEditorWindow.close(self).  Now, class PyShellEditorWindow itself
derives from class OutputWindow, and inherits the close() method from
there without overriding it.  Under the old rules,
PyShellEditorWindow.close would return an unbound method restricted to
the class that defined the implementation of close(), which was
OutputWindow.close.  Under the new rules, the unbound method is
restricted to the class whose method was requested, that is
PyShellEditorWindow, and this was correctly trapped as an error.

Tools/idle/PyShell.py

index 1f05868ea8886c9afbe4c39785a623b063eac2cc..bd34d181632a602a9fe02de1b1801d3614421bee 100644 (file)
@@ -418,7 +418,7 @@ class PyShell(OutputWindow):
             if self.reading:
                 self.top.quit()
             return "cancel"
-        return PyShellEditorWindow.close(self)
+        return OutputWindow.close(self)
 
     def _close(self):
         self.close_debugger()