Mercurial > genshi > genshi-test
diff genshi/template/tests/markup.py @ 935:705727288d7e
Merge r1143 from py3k:
add support for python 3 to remaining genshi.template components:
* minor changes to track encoding=None API change in core genshi modules.
* genshi/template/directives:
* slightly odd syntax changes to make the 2to3 .next() fixer pick up *stream.next()
* minor test fix for change in behaviour of division (/) in Python 3.
* genshi/template/loader:
* add 'b' to file modes to ensure it's loaded as bytes in Python 3.
* use not isinstance(s, unicode) instead of isinstance(s, str) since the former is correctly converted by 2to3.
author | hodgestar |
---|---|
date | Fri, 18 Mar 2011 09:17:52 +0000 |
parents | 3c09c8d8a578 |
children |
line wrap: on
line diff
--- a/genshi/template/tests/markup.py +++ b/genshi/template/tests/markup.py @@ -15,11 +15,11 @@ import os import pickle import shutil -from StringIO import StringIO import sys import tempfile import unittest +from genshi.compat import BytesIO, StringIO from genshi.core import Markup from genshi.input import XML from genshi.template.base import BadDirectiveError, TemplateSyntaxError @@ -43,7 +43,7 @@ def test_pickle(self): stream = XML('<root>$var</root>') tmpl = MarkupTemplate(stream) - buf = StringIO() + buf = BytesIO() pickle.dump(tmpl, buf, 2) buf.seek(0) unpickled = pickle.load(buf)