diff options
author | Zachary Turner <zturner@google.com> | 2016-01-15 22:22:35 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-01-15 22:22:35 +0000 |
commit | 21da1ed15b39620ddc0254743609d760f4c22137 (patch) | |
tree | 6d429cc6283d1243349fac08763cf22e3c2c57aa /lldb/scripts/Python/use_lldb_suite.py | |
parent | feb81bc6820bd38fc2e020e165f00d5123b4c407 (diff) | |
download | bcm5719-llvm-21da1ed15b39620ddc0254743609d760f4c22137.tar.gz bcm5719-llvm-21da1ed15b39620ddc0254743609d760f4c22137.zip |
Fix ResourceWarning about unclosed file in use_lldb_suite_root.py.
llvm-svn: 257945
Diffstat (limited to 'lldb/scripts/Python/use_lldb_suite.py')
-rw-r--r-- | lldb/scripts/Python/use_lldb_suite.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/scripts/Python/use_lldb_suite.py b/lldb/scripts/Python/use_lldb_suite.py index 63a098cea22..f3e358af143 100644 --- a/lldb/scripts/Python/use_lldb_suite.py +++ b/lldb/scripts/Python/use_lldb_suite.py @@ -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() |