summaryrefslogtreecommitdiffstats
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-06-13 21:10:32 (GMT)
committerBrian Curtin <brian@python.org>2011-06-13 21:10:32 (GMT)
commita87d586fd6c4a5dfe4ea89fda288ae8eb66b0134 (patch)
tree420fe483c679d2225cc8bd82eefaecf783999268 /Lib/ntpath.py
parentd25aef55c8b0025dd2ee7de11b526f34ceed6b66 (diff)
parentcdc751720ee7a13ac163da1eedf3a513386c98d4 (diff)
downloadcpython-a87d586fd6c4a5dfe4ea89fda288ae8eb66b0134.zip
cpython-a87d586fd6c4a5dfe4ea89fda288ae8eb66b0134.tar.gz
cpython-a87d586fd6c4a5dfe4ea89fda288ae8eb66b0134.tar.bz2
branch merge?
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index ec8a7ab..826be87 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -672,3 +672,14 @@ except ImportError:
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
+ # attribute to tell whether or not the path is a directory.
+ # This is overkill on Windows - just pass the path to GetFileAttributes
+ # and check the attribute from there.
+ from nt import _isdir as isdir
+except ImportError:
+ # Use genericpath.isdir as imported above.
+ pass