summaryrefslogtreecommitdiff
path: root/python/__init__.py
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2023-01-18 11:15:17 +0800
committerXusheng <xusheng@vector35.com>2023-01-19 09:50:35 +0800
commite4ab8f35ce16baafe11d7056d1d1304f3c057cd5 (patch)
tree415154972bad461bdc2e5a3a93f4c7c6b5f767c0 /python/__init__.py
parent919384bb2bb9216e000750a00793549ef7a46d87 (diff)
Deprecate __len__ of Segment
Print a warning message when a deprecated function/property/class is used
Diffstat (limited to 'python/__init__.py')
-rw-r--r--python/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 6cb7b162..913fde6a 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -75,6 +75,12 @@ from .log import (
log_to_stdout, log_to_stderr, log_to_file, close_logs
)
from .log import log as log_at_level
+from .deprecation import *
+import warnings
+# We must alter the filter settings for DeprecatedWarning. Otherwise, it will never show up.
+# https://docs.python.org/3/library/warnings.html#default-warning-filter
+warnings.filterwarnings('once', '', DeprecatedWarning)
+
# Only load Enterprise Client support on Enterprise builds
if core.BNGetProduct() == "Binary Ninja Enterprise Client":
from .enterprise import *