summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-01-13 13:26:07 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-01-13 13:26:07 (GMT)
commit25771b3749cac588ad2ecc8fc796a496d35769e5 (patch)
treea52dd4608188b760df8202c60501f51fa275bd4c /Modules
parenta9edb6c4d1daa0749547a115ee4b02cc5b8d8ecd (diff)
downloadcpython-25771b3749cac588ad2ecc8fc796a496d35769e5.zip
cpython-25771b3749cac588ad2ecc8fc796a496d35769e5.tar.gz
cpython-25771b3749cac588ad2ecc8fc796a496d35769e5.tar.bz2
Issue #16922: fixed findtext() to return empty Unicode string instead of empty bytes object when there's no text.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_elementtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 274c65e..49441cc 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1129,7 +1129,7 @@ element_findtext(ElementObject *self, PyObject *args, PyObject *kwds)
PyObject* text = element_get_text(item);
if (text == Py_None)
- return PyBytes_FromString("");
+ return PyUnicode_New(0, 0);
Py_XINCREF(text);
return text;
}