#1742: don't raise exception on os.path.relpath("a", "a"), but return os.curdir.

Reported by Jesse Towner.
This commit is contained in:
Georg Brandl 2008-01-06 14:27:15 +00:00
parent e2a902c669
commit 183a084da3
5 changed files with 9 additions and 0 deletions

View file

@ -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