[lxml] lxml version < 2 does not provide an iter method on some elements
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 18 Dec 2008 17:39:14 +0100
changeset 228 27b958dc72ae
parent 227 20d6de0fdcb1
child 229 767ff7f5d5a7
[lxml] lxml version < 2 does not provide an iter method on some elements hence we fall back on another implementation of safe_cut
common/uilib.py
--- a/common/uilib.py	Thu Dec 18 15:43:39 2008 +0100
+++ b/common/uilib.py	Thu Dec 18 17:39:14 2008 +0100
@@ -108,7 +108,8 @@
 
 try:
     from lxml import etree
-except ImportError:
+    etree.HTML('<div>test</div>').iter
+except (ImportError, AttributeError):
     # gae environment: lxml not availabel
     
     def soup2xhtml(data, encoding):