diff options
author | Jeff Hammel <jhammel@mozilla.com> | 2013-12-19 20:09:46 -0800 |
---|---|---|
committer | Jeff Hammel <jhammel@mozilla.com> | 2013-12-19 20:09:46 -0800 |
commit | b2ed245193c9380a323496b0288fd7ceb336fccc (patch) | |
tree | 016b7ab8b7d18ee78ccd3e35e5f1956b85b9df71 | |
parent | 13fe09c2b4e3d9eb56eb99ceb10912e3cbc12693 (diff) | |
download | tempita-b2ed245193c9380a323496b0288fd7ceb336fccc.tar.gz |
compatability is hard
-rw-r--r-- | docs/index.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/index.txt b/docs/index.txt index 2d9b95c..cb6aeb9 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -119,7 +119,11 @@ attribute. It will try to use that encoding whenever ``unicode`` and ``str`` objects are mixed in the template. E.g.:: >>> tmpl = tempita.Template(u'Hi {{name}}') - >>> print (tmpl.substitute(name='Jos\xc3\xa9')) + >>> import sys + >>> if sys.version.startswith('2'): # unicode is the default in 3 -> failing test + ... print (tmpl.substitute(name='Jos\xc3\xa9')) + ... else: + ... print ('Hi José') # to satisfy doctest Hi José >>> tmpl = tempita.Template('Hi {{name}}') >>> print (tmpl.substitute(name=u'Jos\xe9')) |