mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	#1742: don't raise exception on os.path.relpath("a", "a"), but return os.curdir.
Reported by Jesse Towner.
This commit is contained in:
		
							parent
							
								
									e2a902c669
								
							
						
					
					
						commit
						183a084da3
					
				
					 5 changed files with 9 additions and 0 deletions
				
			
		|  | @ -490,4 +490,6 @@ def relpath(path, start=curdir): | |||
|         i += 1 | ||||
| 
 | ||||
|     rel_list = [pardir] * (len(start_list)-i) + path_list[i:] | ||||
|     if not rel_list: | ||||
|         return curdir | ||||
|     return join(*rel_list) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl