diff options
| author | Josh F <josh@vector35.com> | 2021-10-20 13:03:51 -0400 |
|---|---|---|
| committer | Josh F <josh@vector35.com> | 2021-10-20 13:03:51 -0400 |
| commit | e35e6ceda9cd88ae892c47c81da2761c9388870a (patch) | |
| tree | 4545a740b2959381b6b40dc17c275d6d79af1a75 /python | |
| parent | cdc0d5ac31ef3ae1438ceaf05808b9268a01b309 (diff) | |
Update Function.function_type to use types.FunctionType instead of types.Type
Diffstat (limited to 'python')
| -rw-r--r-- | python/function.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/python/function.py b/python/function.py index 3803930e..a0bbeab3 100644 --- a/python/function.py +++ b/python/function.py @@ -782,19 +782,21 @@ class Function: return highlevelil.HighLevelILFunction(self.arch, result, self) @property - def function_type(self) -> 'types.Type': + def function_type(self) -> 'types.FunctionType': """ Function type object, can be set with either a string representing the function prototype (`str(function)` shows examples) or a :py:class:`Type` object """ - return types.Type.create(core.BNGetFunctionType(self.handle), platform = self.platform) + return types.FunctionType(core.BNGetFunctionType(self.handle), platform = self.platform) @function_type.setter - def function_type(self, value:Union['types.Type', str]) -> None: # type: ignore + def function_type(self, value:Union['types.FunctionType', str]) -> None: # type: ignore if isinstance(value, str): - (value, new_name) = self.view.parse_type_string(value) + (parsed_value, new_name) = self.view.parse_type_string(value) self.name = str(new_name) - self.set_user_type(value) + self.set_user_type(parsed_value) + else: + self.set_user_type(value) @property def stack_layout(self) -> Generator['variable.Variable', None, None]: |
