mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Replace os.error with OSError in tkinter and IDLE
This commit is contained in:
		
							parent
							
								
									69d03c4799
								
							
						
					
					
						commit
						786fbd8db7
					
				
					 6 changed files with 8 additions and 8 deletions
				
			
		|  | @ -103,7 +103,7 @@ def canonize(self, filename): | |||
|         if not os.path.isabs(filename): | ||||
|             try: | ||||
|                 pwd = os.getcwd() | ||||
|             except os.error: | ||||
|             except OSError: | ||||
|                 pass | ||||
|             else: | ||||
|                 filename = os.path.join(pwd, filename) | ||||
|  |  | |||
|  | @ -110,7 +110,7 @@ def grep_it(self, prog, path): | |||
|     def findfiles(self, dir, base, rec): | ||||
|         try: | ||||
|             names = os.listdir(dir or os.curdir) | ||||
|         except os.error as msg: | ||||
|         except OSError as msg: | ||||
|             print(msg) | ||||
|             return [] | ||||
|         list = [] | ||||
|  |  | |||
|  | @ -503,7 +503,7 @@ def defaultfilename(self, mode="open"): | |||
|         else: | ||||
|             try: | ||||
|                 pwd = os.getcwd() | ||||
|             except os.error: | ||||
|             except OSError: | ||||
|                 pwd = "" | ||||
|             return pwd, "" | ||||
| 
 | ||||
|  |  | |||
|  | @ -45,7 +45,7 @@ def GetText(self): | |||
|     def GetSubList(self): | ||||
|         try: | ||||
|             names = os.listdir(self.dir or os.curdir) | ||||
|         except os.error: | ||||
|         except OSError: | ||||
|             return [] | ||||
|         packages = [] | ||||
|         for name in names: | ||||
|  |  | |||
|  | @ -382,7 +382,7 @@ def SetText(self, text): | |||
|         try: | ||||
|             os.rename(self.path, newpath) | ||||
|             self.path = newpath | ||||
|         except os.error: | ||||
|         except OSError: | ||||
|             pass | ||||
| 
 | ||||
|     def GetIconName(self): | ||||
|  | @ -395,7 +395,7 @@ def IsExpandable(self): | |||
|     def GetSubList(self): | ||||
|         try: | ||||
|             names = os.listdir(self.path) | ||||
|         except os.error: | ||||
|         except OSError: | ||||
|             return [] | ||||
|         names.sort(key = os.path.normcase) | ||||
|         sublist = [] | ||||
|  |  | |||
|  | @ -166,7 +166,7 @@ def filter_command(self, event=None): | |||
|         dir, pat = self.get_filter() | ||||
|         try: | ||||
|             names = os.listdir(dir) | ||||
|         except os.error: | ||||
|         except OSError: | ||||
|             self.master.bell() | ||||
|             return | ||||
|         self.directory = dir | ||||
|  | @ -209,7 +209,7 @@ def set_filter(self, dir, pat): | |||
|         if not os.path.isabs(dir): | ||||
|             try: | ||||
|                 pwd = os.getcwd() | ||||
|             except os.error: | ||||
|             except OSError: | ||||
|                 pwd = None | ||||
|             if pwd: | ||||
|                 dir = os.path.join(pwd, dir) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andrew Svetlov
						Andrew Svetlov