mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Fix Issue #4875: find_library can return directories instead of files
(on win32)
This commit is contained in:
		
							parent
							
								
									a985a3aee4
								
							
						
					
					
						commit
						a57773e483
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		|  | @ -52,12 +52,12 @@ def find_library(name): | ||||||
|         # See MSDN for the REAL search order. |         # See MSDN for the REAL search order. | ||||||
|         for directory in os.environ['PATH'].split(os.pathsep): |         for directory in os.environ['PATH'].split(os.pathsep): | ||||||
|             fname = os.path.join(directory, name) |             fname = os.path.join(directory, name) | ||||||
|             if os.path.exists(fname): |             if os.path.isfile(fname): | ||||||
|                 return fname |                 return fname | ||||||
|             if fname.lower().endswith(".dll"): |             if fname.lower().endswith(".dll"): | ||||||
|                 continue |                 continue | ||||||
|             fname = fname + ".dll" |             fname = fname + ".dll" | ||||||
|             if os.path.exists(fname): |             if os.path.isfile(fname): | ||||||
|                 return fname |                 return fname | ||||||
|         return None |         return None | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -282,6 +282,9 @@ Core and Builtins | ||||||
| Library | Library | ||||||
| ------- | ------- | ||||||
| 
 | 
 | ||||||
|  | - Issue #4875: On win32, ctypes.util.find_library does no longer | ||||||
|  |   return directories. | ||||||
|  | 
 | ||||||
| - Issue #5142: Add the ability to skip modules while stepping to pdb. | - Issue #5142: Add the ability to skip modules while stepping to pdb. | ||||||
| 
 | 
 | ||||||
| - Issue #1309567: Fix linecache behavior of stripping subdirectories when | - Issue #1309567: Fix linecache behavior of stripping subdirectories when | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thomas Heller
						Thomas Heller