[Python-checkins] cpython: Backed out changeset 8dc144e47252

serhiy.storchaka python-checkins at python.org
Wed Apr 6 16:03:07 EDT 2016


https://hg.python.org/cpython/rev/47b2cdd6c186
changeset:   100864:47b2cdd6c186
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed Apr 06 23:02:25 2016 +0300
summary:
  Backed out changeset 8dc144e47252

files:
  Modules/posixmodule.c |  28 ++--------------------------
  1 files changed, 2 insertions(+), 26 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -884,11 +884,11 @@
 #endif
     }
     else if (PyObject_CheckBuffer(o)) {
-#ifdef MS_WINDOWS
+#  ifdef MS_WINDOWS
         if (win32_warn_bytes_api()) {
             return 0;
         }
-#endif
+#  endif
         bytes = PyBytes_FromObject(o);
         if (!bytes) {
             return 0;
@@ -905,30 +905,6 @@
         return 1;
     }
     else {
-        PyObject *pathattr;
-        _Py_IDENTIFIER(path);
-
-        pathattr = _PyObject_GetAttrId(o, &PyId_path);
-        if (pathattr == NULL) {
-            PyErr_Clear();
-        }
-        else if (PyUnicode_Check(pathattr) || PyObject_CheckBuffer(pathattr)) {
-            if (!path_converter(pathattr, path)) {
-                Py_DECREF(pathattr);
-                return 0;
-            }
-            if (path->cleanup == NULL) {
-                path->cleanup = pathattr;
-            }
-            else {
-                Py_DECREF(pathattr);
-            }
-            return Py_CLEANUP_SUPPORTED;
-        }
-        else {
-            Py_DECREF(pathattr);
-        }
-
         PyErr_Format(PyExc_TypeError, "%s%s%s should be %s, not %.200s",
             path->function_name ? path->function_name : "",
             path->function_name ? ": "                : "",

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


More information about the Python-checkins mailing list