diff options
author | Brian Curtin <brian@python.org> | 2012-12-26 13:03:03 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-12-26 13:03:03 (GMT) |
commit | 490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b (patch) | |
tree | f110633e5ef37e78cecac8701874bb7a02c250bf /Lib/ntpath.py | |
parent | 2bf61abe02d578a9812cb13d4d71e14f481c4cb5 (diff) | |
download | cpython-490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b.zip cpython-490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b.tar.gz cpython-490b32a3976d84eaf1d6ca8cdcb00eac0ce5055b.tar.bz2 |
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.
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r-- | Lib/ntpath.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 2fbb6d69..ae13484 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 |