summaryrefslogtreecommitdiff
path: root/Lib/ntpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r--Lib/ntpath.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 765e1bff32..e121262199 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -521,3 +521,15 @@ def relpath(path, start=curdir):
if not rel_list:
return curdir
return join(*rel_list)
+
+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
+except ImportError:
+ from genericpath import isdir as _isdir
+
+def isdir(path):
+ return _isdir(path)