summaryrefslogtreecommitdiff
path: root/python/__init__.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2020-05-29 11:13:03 -0400
committerPeter LaFosse <peter@vector35.com>2020-05-29 11:13:14 -0400
commit13b7a030ad88730d4fde7dfbe27f6d0b0ae65084 (patch)
tree05bc306a0fc5f0cb8c1a7ee2881c7d6e20edf749 /python/__init__.py
parent8a5f5dcbf2217f5a4f8cc50559a6a780407663e3 (diff)
Remove unnecessary context manager at toplevel, but keep convenience method
Diffstat (limited to 'python/__init__.py')
-rw-r--r--python/__init__.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 82f591db..498b3e4f 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -256,9 +256,9 @@ def get_memory_usage_info():
return result
-class open_view(object):
+def open_view(*args, **kwargs):
"""
- Context Manager for BinaryView objects
+ Open a BinaryView object
:Example:
>>> from binaryninja import *
@@ -268,14 +268,4 @@ class open_view(object):
128
"""
- def __init__(self, *args, **kwargs):
- self.args = args
- self.kwargs = kwargs
-
- def __enter__(self):
- self.view = BinaryViewType.get_view_of_file(*self.args, **self.kwargs)
- return self.view
-
- def __exit__(self, type, value, traceback):
- if self.view is not None:
- self.view.file.close() \ No newline at end of file
+ return BinaryViewType.get_view_of_file_with_options(*args, **kwargs) \ No newline at end of file