[testlib] take care, validator may be None stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 11 Feb 2011 11:37:10 +0100
branchstable
changeset 6979 a8fbcf9b6572
parent 6978 cac71b8a8711
child 6980 8e59c2cdcc99
child 6981 d1a279ece4a0
[testlib] take care, validator may be None
devtools/testlib.py
--- a/devtools/testlib.py	Fri Feb 11 11:29:23 2011 +0100
+++ b/devtools/testlib.py	Fri Feb 11 11:37:10 2011 +0100
@@ -774,6 +774,8 @@
         """raises an exception if the HTML is invalid"""
         output = output.strip()
         validator = self.get_validator(view, output=output)
+        if validator is None:
+            return
         if isinstance(validator, htmlparser.DTDValidator):
             # XXX remove <canvas> used in progress widget, unknown in html dtd
             output = re.sub('<canvas.*?></canvas>', '', output)