diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-01-13 13:22:05 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-01-13 13:22:05 (GMT) |
commit | b09b16741930e614d95cc51172f0106e3c8ecc00 (patch) | |
tree | 99bfacfd30114c88888867c643fabbedbbc9bf73 /Modules | |
parent | ce1519d250ca457e60a91943d7686e2b85764170 (diff) | |
download | cpython-b09b16741930e614d95cc51172f0106e3c8ecc00.zip cpython-b09b16741930e614d95cc51172f0106e3c8ecc00.tar.gz cpython-b09b16741930e614d95cc51172f0106e3c8ecc00.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index c36af5d..17d5d09 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -840,7 +840,7 @@ element_findtext(ElementObject* self, PyObject* args) PyObject* text = element_get_text(item); if (text == Py_None) - return PyBytes_FromString(""); + return PyUnicode_FromString(""); Py_XINCREF(text); return text; } |