Skip to content

Commit e5d21d9

Browse files
committed
Merge pull request jaraco#92 from userzimmermann/samefile
workaround for os.path without samefile()
2 parents c65003a + 8bba59a commit e5d21d9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎path.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,9 @@ def ismount(self):
981981

982982
def samefile(self, other):
983983
""" .. seealso:: :func:`os.path.samefile` """
984+
if not hasattr(self.module, 'samefile'):
985+
other = Path(other).realpath().normpath().normcase()
986+
return self.realpath().normpath().normcase() == other
984987
return self.module.samefile(self, other)
985988

986989
def getatime(self):

0 commit comments

Comments
 (0)