mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
One happens when EditorWindow.close is called twice. Printing a traceback, when IDLE is run from a terminal, is useless and annoying.
This commit is contained in:
		
							parent
							
								
									63dedef48b
								
							
						
					
					
						commit
						dfd34a9cd5
					
				
					 3 changed files with 17 additions and 4 deletions
				
			
		|  | @ -2,6 +2,13 @@ What's New in IDLE 3.8.0 (since 3.7.0) | ||||||
| Released on 2019-10-20? | Released on 2019-10-20? | ||||||
| ====================================== | ====================================== | ||||||
| 
 | 
 | ||||||
|  | bpo-35379: When exiting IDLE, catch any AttributeError.  One happens | ||||||
|  | when EditorWindow.close is called twice.  Printing a traceback, when | ||||||
|  | IDLE is run from a terminal, is useless and annoying. | ||||||
|  | 
 | ||||||
|  | bpo-38183: To avoid test issues, test_idle ignores the user config | ||||||
|  | directory.  It no longer tries to create or access .idlerc or any files | ||||||
|  | within.  Users must run IDLE to discover problems with saving settings. | ||||||
| 
 | 
 | ||||||
| bpo-38077: IDLE no longer adds 'argv' to the user namespace when | bpo-38077: IDLE no longer adds 'argv' to the user namespace when | ||||||
| initializing it.  This bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4. | initializing it.  This bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4. | ||||||
|  |  | ||||||
|  | @ -1061,10 +1061,13 @@ def maybesave(self): | ||||||
|             return self.io.maybesave() |             return self.io.maybesave() | ||||||
| 
 | 
 | ||||||
|     def close(self): |     def close(self): | ||||||
|         reply = self.maybesave() |         try: | ||||||
|         if str(reply) != "cancel": |             reply = self.maybesave() | ||||||
|             self._close() |             if str(reply) != "cancel": | ||||||
|         return reply |                 self._close() | ||||||
|  |             return reply | ||||||
|  |         except AttributeError:  # bpo-35379: close called twice | ||||||
|  |             pass | ||||||
| 
 | 
 | ||||||
|     def _close(self): |     def _close(self): | ||||||
|         if self.io.filename: |         if self.io.filename: | ||||||
|  |  | ||||||
|  | @ -0,0 +1,3 @@ | ||||||
|  | When exiting IDLE, catch any AttributeError.  One happens when | ||||||
|  | EditorWindow.close is called twice.  Printing a traceback, when IDLE is run | ||||||
|  | from a terminal, is useless and annoying. | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Terry Jan Reedy
						Terry Jan Reedy