mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	#7092: Fix additional "-3" warnings in the idlelib package, and convert to absolute imports.
This commit is contained in:
		
							parent
							
								
									f28dd0d1bf
								
							
						
					
					
						commit
						d630c04ab1
					
				
					 37 changed files with 169 additions and 149 deletions
				
			
		|  | @ -2,8 +2,8 @@ | |||
| An auto-completion window for IDLE, used by the AutoComplete extension | ||||
| """ | ||||
| from Tkinter import * | ||||
| from MultiCall import MC_SHIFT | ||||
| import AutoComplete | ||||
| from idlelib.MultiCall import MC_SHIFT | ||||
| from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES | ||||
| 
 | ||||
| HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>" | ||||
| HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>") | ||||
|  | @ -264,7 +264,7 @@ def keypress_event(self, event): | |||
|         if keysym != "Tab": | ||||
|             self.lastkey_was_tab = False | ||||
|         if (len(keysym) == 1 or keysym in ("underscore", "BackSpace") | ||||
|             or (self.mode==AutoComplete.COMPLETE_FILES and keysym in | ||||
|             or (self.mode == COMPLETE_FILES and keysym in | ||||
|                 ("period", "minus"))) \ | ||||
|            and not (state & ~MC_SHIFT): | ||||
|             # Normal editing of text | ||||
|  | @ -292,10 +292,10 @@ def keypress_event(self, event): | |||
|             self.hide_window() | ||||
|             return | ||||
| 
 | ||||
|         elif (self.mode == AutoComplete.COMPLETE_ATTRIBUTES and keysym in | ||||
|         elif (self.mode == COMPLETE_ATTRIBUTES and keysym in | ||||
|               ("period", "space", "parenleft", "parenright", "bracketleft", | ||||
|                "bracketright")) or \ | ||||
|              (self.mode == AutoComplete.COMPLETE_FILES and keysym in | ||||
|              (self.mode == COMPLETE_FILES and keysym in | ||||
|               ("slash", "backslash", "quotedbl", "apostrophe")) \ | ||||
|              and not (state & ~MC_SHIFT): | ||||
|             # If start is a prefix of the selection, but is not '' when | ||||
|  | @ -303,7 +303,7 @@ def keypress_event(self, event): | |||
|             # selected completion. Anyway, close the list. | ||||
|             cursel = int(self.listbox.curselection()[0]) | ||||
|             if self.completions[cursel][:len(self.start)] == self.start \ | ||||
|                and (self.mode==AutoComplete.COMPLETE_ATTRIBUTES or self.start): | ||||
|                and (self.mode == COMPLETE_ATTRIBUTES or self.start): | ||||
|                 self._change_start(self.completions[cursel]) | ||||
|             self.hide_window() | ||||
|             return | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Florent Xicluna
						Florent Xicluna