Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4269601

Browse files
committed
Amazing. A very subtle change in policy in descr-branch actually
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.
1 parent ab1df4f commit 4269601

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Tools/idle/PyShell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def close(self):
418418
if self.reading:
419419
self.top.quit()
420420
return "cancel"
421-
return PyShellEditorWindow.close(self)
421+
return OutputWindow.close(self)
422422

423423
def _close(self):
424424
self.close_debugger()

0 commit comments

Comments
 (0)