提交 976d00aa 编写于 作者: C Cleber Rosa

safeloader: close file opened by imp.find_module

This is causing a lot of ResourceWarnings, specially when running
the selftests.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 ab11e9cf
......@@ -345,8 +345,10 @@ def find_avocado_tests(path, class_name=None):
modules_paths.extend(sys.path)
if parent_module is None:
parent_module = node.module
_, ppath, _ = imp.find_module(parent_module,
mod_file, ppath, _ = imp.find_module(parent_module,
modules_paths)
if mod_file is not None:
mod_file.close()
res, dis = find_avocado_tests(ppath,
parent_class)
if res:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册