From e4ab8f35ce16baafe11d7056d1d1304f3c057cd5 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Wed, 18 Jan 2023 11:15:17 +0800 Subject: Deprecate __len__ of Segment Print a warning message when a deprecated function/property/class is used --- python/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/__init__.py') 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 * -- cgit v1.3.1