Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix a couple of Py3 test issues in doc/elementsoup.txt

  • Loading branch information...
commit 5a396e0f892c4bd92bc50be41117db9a76c5e7b0 1 parent 97e3181
scoder scoder authored

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +4 4 doc/elementsoup.txt
8 doc/elementsoup.txt
@@ -61,7 +61,7 @@ To see what we have here, you can serialise it:
61 61 .. sourcecode:: pycon
62 62
63 63 >>> from lxml.etree import tostring
64   - >>> print tostring(root, pretty_print=True),
  64 + >>> print(tostring(root, pretty_print=True).strip())
65 65 <html>
66 66 <meta/>
67 67 <head>
@@ -131,10 +131,10 @@ Any other encoding will output the respective byte sequences.
131 131 >>> tostring(body, method="html", encoding="utf-8")
132 132 '<body>\xc2\xa9\xe2\x82\xac-\xc3\xb5\xc6\xbd<p></p></body>'
133 133
134   - >>> tostring(body, encoding=unicode)
  134 + >>> tostring(body, encoding='unicode')
135 135 u'<body>\xa9\u20ac-\xf5\u01bd<p/></body>'
136 136
137   - >>> tostring(body, method="html", encoding=unicode)
  137 + >>> tostring(body, method="html", encoding='unicode')
138 138 u'<body>\xa9\u20ac-\xf5\u01bd<p></p></body>'
139 139
140 140
@@ -172,7 +172,7 @@ better.
172 172
173 173 >>> root = lxml.html.fromstring(tag_soup)
174 174 >>> try:
175   - ... ignore = tostring(root, encoding=unicode)
  175 + ... ignore = tostring(root, encoding='unicode')
176 176 ... except UnicodeDecodeError:
177 177 ... root = lxml.html.soupparser.fromstring(tag_soup)
178 178

0 comments on commit 5a396e0

Please sign in to comment.
Something went wrong with that request. Please try again.