mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Fix 'convert_path()' so it returns immediately under Unix -- prevents blowing
up when the pathname starts with '/', which is needed when converting installation directories in the "install" command.
This commit is contained in:
		
							parent
							
								
									f89259786a
								
							
						
					
					
						commit
						7ec053544c
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		|  | @ -68,15 +68,15 @@ def convert_path (pathname): | |||
|        absolute (starts with '/') or contains local directory separators | ||||
|        (unless the local separator is '/', of course).""" | ||||
| 
 | ||||
|     if os.sep == '/': | ||||
|         return pathname | ||||
|     if pathname[0] == '/': | ||||
|         raise ValueError, "path '%s' cannot be absolute" % pathname | ||||
|     if pathname[-1] == '/': | ||||
|         raise ValueError, "path '%s' cannot end with '/'" % pathname | ||||
|     if os.sep != '/': | ||||
| 
 | ||||
|     paths = string.split(pathname, '/') | ||||
|     return apply(os.path.join, paths) | ||||
|     else: | ||||
|         return pathname | ||||
| 
 | ||||
| # convert_path () | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Greg Ward
						Greg Ward