diff options
| author | Stefan Behnel <stefan_ml@behnel.de> | 2012-09-25 12:11:56 +0200 |
|---|---|---|
| committer | Stefan Behnel <stefan_ml@behnel.de> | 2012-09-25 12:11:56 +0200 |
| commit | 4c224d8fbd79eb9c9a4adc57da529b9aa57015bc (patch) | |
| tree | bf7548ec99500b6dab80041fbf759982e4faa352 /doc | |
| parent | e1d35ccb3e8a437f3dc37d5ef05584d43b387c4d (diff) | |
| download | python-lxml-4c224d8fbd79eb9c9a4adc57da529b9aa57015bc.tar.gz | |
PyPy test fixes
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/api.txt | 4 | ||||
| -rw-r--r-- | doc/parsing.txt | 8 | ||||
| -rw-r--r-- | doc/tutorial.txt | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/doc/api.txt b/doc/api.txt index bcc96449..efc08103 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -54,8 +54,8 @@ lxml is extremely extensible through `XPath functions in Python`_, custom ... class deque(list): ... def popleft(self): return self.pop(0) - >>> try: unicode = __builtins__["unicode"] - ... except (NameError, KeyError): unicode = str + >>> try: unicode = unicode + ... except NameError: unicode = str lxml.etree diff --git a/doc/parsing.txt b/doc/parsing.txt index 9629afa8..e53f76d8 100644 --- a/doc/parsing.txt +++ b/doc/parsing.txt @@ -40,8 +40,8 @@ The usual setup procedure: ... if isinstance(s, str): s = s.encode("UTF-8") ... return BytesIO(s) - >>> try: unicode = __builtins__["unicode"] - ... except (NameError, KeyError): unicode = str + >>> try: unicode = unicode + ... except NameError: unicode = str >>> import sys >>> from lxml import etree as _etree @@ -328,7 +328,7 @@ a target object to the parser: >>> class EchoTarget: ... def start(self, tag, attrib): - ... print("start %s %s" % (tag, attrib)) + ... print("start %s %r" % (tag, dict(attrib))) ... def end(self, tag): ... print("end %s" % tag) ... def data(self, data): @@ -382,7 +382,7 @@ that the parser can reuse them afterwards. ... def __init__(self): ... self.events = [] ... def start(self, tag, attrib): - ... self.events.append("start %s %s" % (tag, attrib)) + ... self.events.append("start %s %r" % (tag, dict(attrib))) ... def end(self, tag): ... self.events.append("end %s" % tag) ... def data(self, data): diff --git a/doc/tutorial.txt b/doc/tutorial.txt index 7af1ec46..758c7871 100644 --- a/doc/tutorial.txt +++ b/doc/tutorial.txt @@ -49,10 +49,10 @@ documentation`_. ... if isinstance(s, str): s = s.encode("UTF-8") ... return BytesIO(s) - >>> try: unicode = __builtins__["unicode"] + >>> try: unicode = unicode ... except (NameError, KeyError): unicode = str - >>> try: basestring = __builtins__["basestring"] + >>> try: basestring = basestring ... except (NameError, KeyError): basestring = str |
