Fix pylint E1111 Error on pkg_resource
Change-Id: I3e5a26ca020235620fbd7d01425c5062cd055381
This commit is contained in:
parent
3fb9ff22cb
commit
0ae706875b
|
@ -68,8 +68,8 @@ def fromstring(text, root_tag=None):
|
||||||
# validate XML
|
# validate XML
|
||||||
try:
|
try:
|
||||||
path = 'schema/%s.rng' % camel_to_snake(root_tag)
|
path = 'schema/%s.rng' % camel_to_snake(root_tag)
|
||||||
rng = resource_stream(__name__, path)
|
with resource_stream(__name__, path) as rng:
|
||||||
lxml.etree.RelaxNG(file=rng).assertValid(elem)
|
lxml.etree.RelaxNG(file=rng).assertValid(elem)
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
# Probably, the schema file doesn't exist.
|
# Probably, the schema file doesn't exist.
|
||||||
exc_type, exc_value, exc_traceback = sys.exc_info()
|
exc_type, exc_value, exc_traceback = sys.exc_info()
|
||||||
|
|
Loading…
Reference in New Issue