summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-01-13 13:22:05 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-01-13 13:22:05 (GMT)
commitb09b16741930e614d95cc51172f0106e3c8ecc00 (patch)
tree99bfacfd30114c88888867c643fabbedbbc9bf73 /Lib
parentce1519d250ca457e60a91943d7686e2b85764170 (diff)
downloadcpython-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 'Lib')
-rw-r--r--Lib/test/test_xml_etree.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 3092f3b..f61292f 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -352,6 +352,8 @@ def find():
'subtext'
>>> ET.ElementTree(elem).findtext("section/tag")
'subtext'
+ >>> ET.XML('<root><empty /></root>').findtext('empty')
+ ''
>>> summarize_list(elem.findall("."))
['body']
>>> summarize_list(elem.findall("tag"))