diff options
author | Brian Curtin <brian@python.org> | 2011-06-09 00:29:53 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2011-06-09 00:29:53 (GMT) |
commit | caea7e8d231bb78a32636890edfd8c350a70ea4b (patch) | |
tree | aeb6bc59e66d6469288a44a25d60c85f3ff3f106 /Lib/ntpath.py | |
parent | ce5493f33d75de2861ccadc618f6f250ab11d2f4 (diff) | |
download | cpython-caea7e8d231bb78a32636890edfd8c350a70ea4b.zip cpython-caea7e8d231bb78a32636890edfd8c350a70ea4b.tar.gz cpython-caea7e8d231bb78a32636890edfd8c350a70ea4b.tar.bz2 |
Merge
Diffstat (limited to 'Lib/ntpath.py')
-rw-r--r-- | Lib/ntpath.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 765e1bf..e121262 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) |