mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									ab1df4fe88
								
							
						
					
					
						commit
						4269601f5c
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -418,7 +418,7 @@ def close(self): | ||||||
|             if self.reading: |             if self.reading: | ||||||
|                 self.top.quit() |                 self.top.quit() | ||||||
|             return "cancel" |             return "cancel" | ||||||
|         return PyShellEditorWindow.close(self) |         return OutputWindow.close(self) | ||||||
| 
 | 
 | ||||||
|     def _close(self): |     def _close(self): | ||||||
|         self.close_debugger() |         self.close_debugger() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum