[Python-checkins] cpython (merge 3.2 -> default): Merge 3.2

brian.curtin python-checkins at python.org
Thu Jun 9 17:01:24 CEST 2011


http://hg.python.org/cpython/rev/7f218ed216e2
changeset:   70737:7f218ed216e2
parent:      70735:6feb5c87a7fb
parent:      70736:d40609dd01e0
user:        Brian Curtin <brian at python.org>
date:        Thu Jun 09 09:46:21 2011 -0500
summary:
  Merge 3.2

files:
  Lib/ntpath.py         |  8 +++-----
  Modules/posixmodule.c |  5 ++++-
  2 files changed, 7 insertions(+), 6 deletions(-)


diff --git a/Lib/ntpath.py b/Lib/ntpath.py
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -679,9 +679,7 @@
     # 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
+    from nt import _isdir as isdir
 except ImportError:
-    from genericpath import isdir as _isdir
-
-def isdir(path):
-    return _isdir(path)
+    # Use genericpath.isdir as imported above.
+    pass
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2961,6 +2961,9 @@
                                 info.nFileIndexLow);
 }
 
+PyDoc_STRVAR(posix__isdir__doc__,
+"Return true if the pathname refers to an existing directory.");
+
 static PyObject *
 posix__isdir(PyObject *self, PyObject *args)
 {
@@ -9597,7 +9600,7 @@
     {"_getfullpathname",        posix__getfullpathname, METH_VARARGS, NULL},
     {"_getfinalpathname",       posix__getfinalpathname, METH_VARARGS, NULL},
     {"_getfileinformation",     posix__getfileinformation, METH_VARARGS, NULL},
-    {"_isdir",                  posix__isdir, METH_VARARGS, NULL},
+    {"_isdir",                  posix__isdir, METH_VARARGS, posix__isdir__doc__},
 #endif
 #ifdef HAVE_GETLOADAVG
     {"getloadavg",      posix_getloadavg, METH_NOARGS, posix_getloadavg__doc__},

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list