summaryrefslogtreecommitdiff
path: root/python/function.py
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2023-02-13 14:27:59 -0500
committerJosh Ferrell <josh@vector35.com>2023-02-13 14:27:59 -0500
commit155b63c35683ded76398d3c97bc9db57790f4bbb (patch)
treef9d2e22ffc7d75982d25d9c1b51eb2f2d0053509 /python/function.py
parent38fb1d656559cb4fb95201077d7aaf57d992a8c5 (diff)
Add __version__ attribute to python api, allow marking deprecation with future version marker
Diffstat (limited to 'python/function.py')
-rw-r--r--python/function.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/python/function.py b/python/function.py
index 856d9cca..86662cf7 100644
--- a/python/function.py
+++ b/python/function.py
@@ -45,6 +45,7 @@ from . import flowgraph
from . import callingconvention
from . import workflow
from . import deprecation
+from . import __version__
# we define the following as such so the linter doesn't confuse 'highlight' the module with the
# property of the same name. There is probably some other work around but it eludes me.
@@ -960,9 +961,8 @@ class Function:
return None
return highlevelil.HighLevelILFunction(self.arch, result, self)
- # TODO: Uncomment, move below the property decorator, and mark deprecated after the next stable
- #@deprecation.deprecated(details="Use .type instead.")
@property
+ @deprecation.deprecated(details="Use .type instead", deprecated_in="3.4", current_version=__version__)
def function_type(self) -> 'types.FunctionType':
"""
Function type object, can be set with either a string representing the function prototype
@@ -970,9 +970,8 @@ class Function:
"""
return self.type
- # TODO: Uncomment, move below the setter decorator, and mark deprecated after the next stable
- #@deprecation.deprecated(details="Use .type instead.")
@function_type.setter
+ @deprecation.deprecated(details="Use .type instead", deprecated_in="3.4", current_version=__version__)
def function_type(self, value: Union['types.FunctionType', str]) -> None:
self.type = value