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
1 changed files with 2 additions and 2 deletions

View File

@ -68,8 +68,8 @@ def fromstring(text, root_tag=None):
# validate XML
try:
path = 'schema/%s.rng' % camel_to_snake(root_tag)
rng = resource_stream(__name__, path)
lxml.etree.RelaxNG(file=rng).assertValid(elem)
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.
exc_type, exc_value, exc_traceback = sys.exc_info()