deprecation module

Class

Description

binaryninja.deprecation.DeprecatedWarning

A warning class for deprecated methods

binaryninja.deprecation.UnsupportedWarning

A warning class for methods to be removed

DeprecatedWarning

class DeprecatedWarning[source]

Bases: DeprecationWarning

A warning class for deprecated methods

This is a specialization of the built-in DeprecationWarning, adding parameters that allow us to get information into the __str__ that ends up being sent through the warnings system. The attributes aren’t able to be retrieved after the warning gets raised and passed through the system as only the class–not the instance–and message are what gets preserved.

Parameters:
  • function – The function being deprecated.

  • deprecated_in – The version that function is deprecated in

  • removed_in – The version or datetime.date specifying when function gets removed.

  • details – Optional details about the deprecation. Most often this will include directions on what to use instead of the now deprecated code.

__init__(function, deprecated_in, removed_in, details='')[source]

UnsupportedWarning

class UnsupportedWarning[source]

Bases: DeprecatedWarning

A warning class for methods to be removed

This is a subclass of DeprecatedWarning and is used to output a proper message about a function being unsupported. Additionally, the fail_if_not_removed decorator will handle this warning and cause any tests to fail if the system under test uses code that raises this warning.