diff options
author | Eli Bendersky <eliben@gmail.com> | 2012-07-17 02:45:11 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2012-07-17 02:45:11 (GMT) |
commit | 426e248febc4b86ea4512baaaa81966ab54c83da (patch) | |
tree | e328da11b7ab6473ef0e212e21d39b3fb2ceb025 /Lib/xml | |
parent | daa4c6b2e68c8ab0d929d9f00db45819431b4e3d (diff) | |
download | cpython-426e248febc4b86ea4512baaaa81966ab54c83da.zip cpython-426e248febc4b86ea4512baaaa81966ab54c83da.tar.gz cpython-426e248febc4b86ea4512baaaa81966ab54c83da.tar.bz2 |
Preserve the invariant tostring(elem) == b''.join(tostringlist(elem)) and add a test to make sure it keeps working
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/etree/ElementTree.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 10bf849..3981659 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -1190,9 +1190,15 @@ def tostringlist(element, encoding=None, method=None): def writable(self): return True + def seekable(self): + return True + def write(self, b): data.append(b) + def tell(self): + return len(data) + ElementTree(element).write(DataStream(), encoding, method=method) return data |