mirror of
				https://github.com/python/cpython.git
				synced 2025-11-01 06:01:29 +00:00 
			
		
		
		
	[3.13] gh-121295: Fix blocked console after interrupting a long paste (GH-121815) (GH-121826)
(cherry picked from commit 498a94c198)
Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
			
			
This commit is contained in:
		
							parent
							
								
									73f77e642a
								
							
						
					
					
						commit
						4a62fdf35d
					
				
					 2 changed files with 11 additions and 1 deletions
				
			
		|  | @ -157,7 +157,15 @@ def maybe_run_command(statement: str) -> bool: | |||
|             assert not more | ||||
|             input_n += 1 | ||||
|         except KeyboardInterrupt: | ||||
|             console.write("KeyboardInterrupt\n") | ||||
|             r = _get_reader() | ||||
|             if r.last_command and 'isearch' in r.last_command.__name__: | ||||
|                 r.isearch_direction = '' | ||||
|                 r.console.forgetinput() | ||||
|                 r.pop_input_trans() | ||||
|                 r.dirty = True | ||||
|             r.refresh() | ||||
|             r.in_bracketed_paste = False | ||||
|             console.write("\nKeyboardInterrupt\n") | ||||
|             console.resetbuffer() | ||||
|         except MemoryError: | ||||
|             console.write("\nMemoryError\n") | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Miss Islington (bot)
						Miss Islington (bot)