[Lldb-commits] [lldb] r257945 - Fix ResourceWarning about unclosed file in use_lldb_suite_root.py.
Zachary Turner via lldb-commits
lldb-commits at lists.llvm.org
Fri Jan 15 14:22:35 PST 2016
Author: zturner
Date: Fri Jan 15 16:22:35 2016
New Revision: 257945
URL: http://llvm.org/viewvc/llvm-project?rev=257945&view=rev
Log:
Fix ResourceWarning about unclosed file in use_lldb_suite_root.py.
Modified:
lldb/trunk/scripts/Python/use_lldb_suite.py
lldb/trunk/scripts/use_lldb_suite.py
lldb/trunk/test/use_lldb_suite.py
Modified: lldb/trunk/scripts/Python/use_lldb_suite.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/use_lldb_suite.py?rev=257945&r1=257944&r2=257945&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/use_lldb_suite.py (original)
+++ lldb/trunk/scripts/Python/use_lldb_suite.py Fri Jan 15 16:22:35 2016
@@ -17,6 +17,9 @@ def find_lldb_root():
lldb_root = find_lldb_root()
if lldb_root is not None:
import imp
- module = imp.find_module("use_lldb_suite_root", [lldb_root])
- if module is not None:
- imp.load_module("use_lldb_suite_root", *module)
+ fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root])
+ try:
+ imp.load_module("use_lldb_suite_root", fp, pathname, desc)
+ finally:
+ if fp:
+ fp.close()
Modified: lldb/trunk/scripts/use_lldb_suite.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/use_lldb_suite.py?rev=257945&r1=257944&r2=257945&view=diff
==============================================================================
--- lldb/trunk/scripts/use_lldb_suite.py (original)
+++ lldb/trunk/scripts/use_lldb_suite.py Fri Jan 15 16:22:35 2016
@@ -17,6 +17,9 @@ def find_lldb_root():
lldb_root = find_lldb_root()
if lldb_root is not None:
import imp
- module = imp.find_module("use_lldb_suite_root", [lldb_root])
- if module is not None:
- imp.load_module("use_lldb_suite_root", *module)
+ fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root])
+ try:
+ imp.load_module("use_lldb_suite_root", fp, pathname, desc)
+ finally:
+ if fp:
+ fp.close()
Modified: lldb/trunk/test/use_lldb_suite.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/use_lldb_suite.py?rev=257945&r1=257944&r2=257945&view=diff
==============================================================================
--- lldb/trunk/test/use_lldb_suite.py (original)
+++ lldb/trunk/test/use_lldb_suite.py Fri Jan 15 16:22:35 2016
@@ -17,6 +17,9 @@ def find_lldb_root():
lldb_root = find_lldb_root()
if lldb_root is not None:
import imp
- module = imp.find_module("use_lldb_suite_root", [lldb_root])
- if module is not None:
- imp.load_module("use_lldb_suite_root", *module)
+ fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root])
+ try:
+ imp.load_module("use_lldb_suite_root", fp, pathname, desc)
+ finally:
+ if fp:
+ fp.close()
More information about the lldb-commits
mailing list