fixed logging error (logging module was not imported)
This commit is contained in:
parent
1e009513ee
commit
02ca5f0e42
@ -8,6 +8,7 @@
|
|||||||
from . import base
|
from . import base
|
||||||
from xml.etree import cElementTree
|
from xml.etree import cElementTree
|
||||||
from xml.parsers.expat import ExpatError
|
from xml.parsers.expat import ExpatError
|
||||||
|
import logging
|
||||||
|
|
||||||
ignore_ns = False
|
ignore_ns = False
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ class MatchXMLMask(base.MatcherBase):
|
|||||||
try:
|
try:
|
||||||
maskobj = cElementTree.fromstring(maskobj)
|
maskobj = cElementTree.fromstring(maskobj)
|
||||||
except ExpatError:
|
except ExpatError:
|
||||||
logging.log(logging.WARNING, "Expat error: %s\nIn parsing: %s" % ('', maskobj))
|
logging.exception( "Expat error parsing: %s", maskobj)
|
||||||
if not use_ns and source.tag.split('}', 1)[-1] != maskobj.tag.split('}', 1)[-1]: # strip off ns and compare
|
if not use_ns and source.tag.split('}', 1)[-1] != maskobj.tag.split('}', 1)[-1]: # strip off ns and compare
|
||||||
return False
|
return False
|
||||||
if use_ns and (source.tag != maskobj.tag and "{%s}%s" % (self.default_ns, maskobj.tag) != source.tag ):
|
if use_ns and (source.tag != maskobj.tag and "{%s}%s" % (self.default_ns, maskobj.tag) != source.tag ):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user