Fix pylint E1111 Error on pkg_resource

Change-Id: I3e5a26ca020235620fbd7d01425c5062cd055381
This commit is contained in:
Kota Tsuyuzaki
2015-12-22 04:20:16 -08:00
parent 3fb9ff22cb
commit 0ae706875b

View File

@@ -68,7 +68,7 @@ def fromstring(text, root_tag=None):
# validate XML
try:
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)
except IOError as e:
# Probably, the schema file doesn't exist.