From bc5c0977dc5b4087e8f39cc67089bb5709aac04e Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Wed, 23 Jun 2021 20:20:50 -0400 Subject: type hints for highlevelil.py, mediumlevelil.py and lowlevelil.py, workflow.py Fix linter error in scriptingprovider.py Update workflow.py using updated paradigms and type hints --- python/function.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/function.py') diff --git a/python/function.py b/python/function.py index 36ecc52f..3aba76f2 100644 --- a/python/function.py +++ b/python/function.py @@ -253,7 +253,8 @@ class Function: def __init__(self, view:Optional['binaryview.BinaryView']=None, handle:Optional[core.BNFunction]=None): self._advanced_analysis_requests = 0 assert handle is not None, "creation of standalone 'Function' objects is not implemented" - self.handle = core.handle_of_type(handle, core.BNFunction) + FunctionHandle = ctypes.POINTER(core.BNFunction) + self.handle = ctypes.cast(handle, FunctionHandle) if view is None: self._view = binaryview.BinaryView(handle = core.BNGetFunctionData(self.handle)) else: @@ -930,7 +931,7 @@ class Function: @property def session_data(self) -> Any: """Dictionary object where plugins can store arbitrary data associated with the function""" - handle = ctypes.cast(self.handle, ctypes.c_void_p) + handle = ctypes.cast(self.handle, ctypes.c_void_p) # type: ignore if handle.value not in Function._associated_data: obj = _FunctionAssociatedDataStore() Function._associated_data[handle.value] = obj -- cgit v1.3.1