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/basicblock.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/basicblock.py') diff --git a/python/basicblock.py b/python/basicblock.py index 7104f418..4aca6de5 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -51,7 +51,8 @@ class BasicBlockEdge: class BasicBlock: def __init__(self, handle:core.BNBasicBlockHandle, view:Optional['binaryninja.binaryview.BinaryView']=None): self._view = view - self.handle = core.handle_of_type(handle, core.BNBasicBlock) + _handle = core.BNBasicBlockHandle + self.handle:core.BNBasicBlockHandle = ctypes.cast(handle, _handle) self._arch = None self._func = None self._instStarts:Optional[List[int]] = None @@ -144,7 +145,7 @@ class BasicBlock: self._instStarts.append(start) start += length - def _create_instance(self, handle:core.BNBasicBlock, view:'binaryninja.binaryview.BinaryView') -> 'BasicBlock': + def _create_instance(self, handle:core.BNBasicBlockHandle, view:'binaryninja.binaryview.BinaryView') -> 'BasicBlock': """Internal method used to instantiate child instances""" return BasicBlock(handle, view) -- cgit v1.3.1