diff options
| author | Stefan Behnel <stefan_ml@behnel.de> | 2014-02-20 20:24:58 +0100 |
|---|---|---|
| committer | Stefan Behnel <stefan_ml@behnel.de> | 2014-02-20 20:24:58 +0100 |
| commit | ac8b6539b4c062e01ff6ef6554df43980b24555d (patch) | |
| tree | 9e5111d6fbaf969eef209a10c2ff8d1ecf8dc85b /src/lxml/html | |
| parent | 6d80ef1f55cddb4b18747d3d687ac086855b3dca (diff) | |
| download | python-lxml-ac8b6539b4c062e01ff6ef6554df43980b24555d.tar.gz | |
minor code simplification
Diffstat (limited to 'src/lxml/html')
| -rw-r--r-- | src/lxml/html/__init__.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lxml/html/__init__.py b/src/lxml/html/__init__.py index dd526114..270c5b37 100644 --- a/src/lxml/html/__init__.py +++ b/src/lxml/html/__init__.py @@ -1527,11 +1527,10 @@ def html_to_xhtml(html): except AttributeError: pass prefix = "{%s}" % XHTML_NAMESPACE - for el in html.iter(): + for el in html.iter(etree.Element): tag = el.tag - if isinstance(tag, basestring): - if tag[0] != '{': - el.tag = prefix + tag + if tag[0] != '{': + el.tag = prefix + tag def xhtml_to_html(xhtml): """Convert all tags in an XHTML tree to HTML by removing their |
