mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +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
|
@ -501,6 +501,7 @@ class PosixPathTest(unittest.TestCase):
|
|||
self.assertEqual(posixpath.relpath("a", "../b"), "../"+curdir+"/a")
|
||||
self.assertEqual(posixpath.relpath("a/b", "../c"), "../"+curdir+"/a/b")
|
||||
self.assertEqual(posixpath.relpath("a", "b/c"), "../../a")
|
||||
self.assertEqual(posixpath.relpath("a", "a"), ".")
|
||||
finally:
|
||||
os.getcwd = real_getcwd
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue