From 490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b Mon Sep 17 00:00:00 2001 From: Brian Curtin Date: Wed, 26 Dec 2012 07:03:03 -0600 Subject: Fix #11939. Set st_dev attribute on Windows to simplify os.path.samefile. By setting the st_dev attribute, we can then remove some Windows-specific code and move os.path.samefile/sameopenfile/samestat to Lib/genericpath.py so all platforms share the same implementation. --- Lib/ntpath.py | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'Lib/ntpath.py') diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 2fbb6d69dd..ae134846c5 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -652,23 +652,6 @@ except (AttributeError, ImportError): def _getfinalpathname(f): return normcase(abspath(f)) -def samefile(f1, f2): - "Test whether two pathnames reference the same actual file" - return _getfinalpathname(f1) == _getfinalpathname(f2) - - -try: - from nt import _getfileinformation -except ImportError: - # On other operating systems, just return the fd and see that - # it compares equal in sameopenfile. - def _getfileinformation(fd): - return fd - -def sameopenfile(f1, f2): - """Test whether two file objects reference the same file""" - return _getfileinformation(f1) == _getfileinformation(f2) - try: # The genericpath.isdir implementation uses os.stat and checks the mode -- cgit v1.2.1