diff --git a/python/architecture.py b/python/architecture.py index 27548724d..f154d5c19 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -2687,7 +2687,7 @@ def fastcall_calling_convention(self, cc: 'callingconvention.CallingConvention') class CoreArchitecture(Architecture): def __init__(self, handle: core.BNArchitecture): - super(CoreArchitecture, self).__init__() + super().__init__() self.handle = core.handle_of_type(handle, core.BNArchitecture) self.name = core.BNGetArchitectureName(self.handle) @@ -3361,7 +3361,7 @@ def get_flags_required_for_flag_condition( class ArchitectureHook(CoreArchitecture): def __init__(self, base_arch: 'Architecture'): self._base_arch = base_arch - super(ArchitectureHook, self).__init__(base_arch.handle) + super().__init__(base_arch.handle) # To improve performance of simpler hooks, use null callback for functions that are not being overridden if self.get_associated_arch_by_address.__code__ == CoreArchitecture.get_associated_arch_by_address.__code__: diff --git a/python/binaryview.py b/python/binaryview.py index b5661e124..5a2a2e124 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -280,7 +280,7 @@ class BinaryDataNotification: >>> class NotifyTest(binaryninja.BinaryDataNotification): ... def __init__(self): - ... super(NotifyTest, self).__init__(binaryninja.NotificationType.NotificationBarrier | binaryninja.NotificationType.FunctionLifetime | binaryninja.NotificationType.FunctionUpdated) + ... super().__init__(binaryninja.NotificationType.NotificationBarrier | binaryninja.NotificationType.FunctionLifetime | binaryninja.NotificationType.FunctionUpdated) ... self.received_event = False ... def notification_barrier(self, view: 'BinaryView') -> int: ... has_events = self.received_event @@ -12228,7 +12228,7 @@ def auto_discovered(self) -> bool: class DataVariable(CoreDataVariable): def __init__(self, view: BinaryView, address: int, type: '_types.Type', auto_discovered: bool): - super(DataVariable, self).__init__(address, type, auto_discovered) + super().__init__(address, type, auto_discovered) self.view = view self._accessor = TypedDataAccessor(self.type, self.address, self.view, self.view.endianness) @@ -12324,7 +12324,7 @@ def components(self) -> List[component.Component]: class DataVariableAndName(CoreDataVariable): def __init__(self, addr: int, var_type: '_types.Type', var_name: str, auto_discovered: bool) -> None: - super(DataVariableAndName, self).__init__(addr, var_type, auto_discovered) + super().__init__(addr, var_type, auto_discovered) self.name = var_name def __repr__(self) -> str: diff --git a/python/constantrenderer.py b/python/constantrenderer.py index ec411959b..0dafd05ec 100644 --- a/python/constantrenderer.py +++ b/python/constantrenderer.py @@ -205,7 +205,7 @@ def render_constant_pointer( class CoreConstantRenderer(ConstantRenderer): def __init__(self, handle: core.BNConstantRenderer): - super(CoreConstantRenderer, self).__init__(handle=handle) + super().__init__(handle=handle) if type(self) is CoreConstantRenderer: global _renderer_cache _renderer_cache[ctypes.addressof(handle.contents)] = self diff --git a/python/deprecation.py b/python/deprecation.py index a97e21014..c6790e58d 100644 --- a/python/deprecation.py +++ b/python/deprecation.py @@ -67,7 +67,7 @@ def __init__(self, function, deprecated_in, removed_in, details=""): self.deprecated_in = deprecated_in self.removed_in = removed_in self.details = details - super(DeprecatedWarning, self).__init__(function, deprecated_in, + super().__init__(function, deprecated_in, removed_in, details) def __str__(self): diff --git a/python/downloadprovider.py b/python/downloadprovider.py index 8576ae810..2a171f88c 100644 --- a/python/downloadprovider.py +++ b/python/downloadprovider.py @@ -370,7 +370,7 @@ def create_instance(self): class PythonDownloadInstance(DownloadInstance): def __init__(self, provider): - super(PythonDownloadInstance, self).__init__(provider) + super().__init__(provider) def perform_destroy_instance(self): pass @@ -466,7 +466,7 @@ class PythonDownloadProvider(DownloadProvider): class PythonDownloadInstance(DownloadInstance): def __init__(self, provider): - super(PythonDownloadInstance, self).__init__(provider) + super().__init__(provider) def perform_destroy_instance(self): pass diff --git a/python/flowgraph.py b/python/flowgraph.py index dc2185de1..e7987fc8c 100644 --- a/python/flowgraph.py +++ b/python/flowgraph.py @@ -921,7 +921,7 @@ def remove_render_layer(self, layer: 'binaryninja.RenderLayer'): class CoreFlowGraph(FlowGraph): def __init__(self, handle): - super(CoreFlowGraph, self).__init__(handle) + super().__init__(handle) def update(self): graph = core.BNUpdateFlowGraph(self.handle) diff --git a/python/highlevelil.py b/python/highlevelil.py index d6c1ce1a0..bbb19cdf6 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -5186,7 +5186,7 @@ class HighLevelILBasicBlock(basicblock.BasicBlock): def __init__( self, handle: core.BNBasicBlockHandle, owner: HighLevelILFunction, view: Optional['binaryview.BinaryView'] ): - super(HighLevelILBasicBlock, self).__init__(handle, view) + super().__init__(handle, view) self._il_function = owner def __iter__(self) -> Generator[HighLevelILInstruction, None, None]: diff --git a/python/languagerepresentation.py b/python/languagerepresentation.py index 7e1c01d3d..393bb4be9 100644 --- a/python/languagerepresentation.py +++ b/python/languagerepresentation.py @@ -872,7 +872,7 @@ def __repr__(self): class CoreLanguageRepresentationFunctionType(LanguageRepresentationFunctionType): def __init__(self, handle: core.BNLanguageRepresentationFunctionTypeHandle): - super(CoreLanguageRepresentationFunctionType, self).__init__(handle=handle) + super().__init__(handle=handle) if type(self) is CoreLanguageRepresentationFunctionType: global _language_cache _language_cache[ctypes.addressof(handle.contents)] = self diff --git a/python/lineformatter.py b/python/lineformatter.py index 25d456584..253b86067 100644 --- a/python/lineformatter.py +++ b/python/lineformatter.py @@ -247,7 +247,7 @@ def __repr__(self): class CoreLineFormatter(LineFormatter): def __init__(self, handle: core.BNLineFormatter): - super(CoreLineFormatter, self).__init__(handle=handle) + super().__init__(handle=handle) if type(self) is CoreLineFormatter: global _formatter_cache _formatter_cache[ctypes.addressof(handle.contents)] = self diff --git a/python/lowlevelil.py b/python/lowlevelil.py index f9d12425d..daabc9480 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -6678,7 +6678,7 @@ class LowLevelILBasicBlock(basicblock.BasicBlock): def __init__( self, handle: core.BNBasicBlockHandle, owner: LowLevelILFunction, view: Optional['binaryview.BinaryView'] ): - super(LowLevelILBasicBlock, self).__init__(handle, view) + super().__init__(handle, view) self._il_function = owner def __hash__(self): diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 51820caf4..db6635f6d 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -7017,7 +7017,7 @@ def __init__( self, handle: core.BNBasicBlockHandle, owner: MediumLevelILFunction, view: Optional['binaryview.BinaryView'] = None ): - super(MediumLevelILBasicBlock, self).__init__(handle, view) + super().__init__(handle, view) self._il_function = owner def __iter__(self): diff --git a/python/platform.py b/python/platform.py index 2e8ad846c..ca6b1616f 100644 --- a/python/platform.py +++ b/python/platform.py @@ -796,7 +796,7 @@ def arch(self): class CorePlatform(Platform): def __init__(self, handle: core.BNPlatform): - super(CorePlatform, self).__init__(handle=handle) + super().__init__(handle=handle) if type(self) is CorePlatform: global _platform_cache _platform_cache[ctypes.addressof(handle.contents)] = self diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index b1f83ec45..75491cd24 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -638,7 +638,7 @@ def readline(self): class BlacklistedDict(dict): def __init__(self, blacklist, *args): - super(BlacklistedDict, self).__init__(*args) + super().__init__(*args) self.__blacklist = set(blacklist) self._blacklist_enabled = True @@ -648,7 +648,7 @@ def __setitem__(self, k, v): 'Setting variable "{}" will have no affect as it is automatically controlled by the ScriptingProvider.\n'. format(k) ) - super(BlacklistedDict, self).__setitem__(k, v) + super().__setitem__(k, v) def enable_blacklist(self, enabled): self.__enable_blacklist = enabled @@ -947,7 +947,7 @@ def write_at_cursor(self, data): return self.active_view.insert(self.active_selection_begin, data) def __init__(self, provider): - super(PythonScriptingInstance, self).__init__(provider) + super().__init__(provider) self.interpreter = PythonScriptingInstance.InterpreterThread(self) self.interpreter.start() self.queued_input = "" diff --git a/python/stringrecognizer.py b/python/stringrecognizer.py index 77a11c46f..89f7f0037 100644 --- a/python/stringrecognizer.py +++ b/python/stringrecognizer.py @@ -421,7 +421,7 @@ def recognize_struct_init( class CoreStringRecognizer(StringRecognizer): def __init__(self, handle: core.BNStringRecognizer): - super(CoreStringRecognizer, self).__init__(handle=handle) + super().__init__(handle=handle) if type(self) is CoreStringRecognizer: global _recognizer_cache _recognizer_cache[ctypes.addressof(handle.contents)] = self diff --git a/python/types.py b/python/types.py index 04ec5e780..6c2e91669 100644 --- a/python/types.py +++ b/python/types.py @@ -436,7 +436,7 @@ def __init__( _namespace = NameSpace.get_core_struct(namespace) _handle = core.BNCreateSymbol(sym_type, short_name, full_name, raw_name, addr, binding, _namespace, ordinal) assert _handle is not None, "core.BNCreateSymbol return None" - super(Symbol, self).__init__(_handle) + super().__init__(_handle) @dataclass @@ -805,7 +805,7 @@ def __exit__(self, type, value, traceback): class TypeBuilderAttributes(dict): def __init__(self, builder: 'TypeBuilder', *args): - super(TypeBuilderAttributes, self).__init__(*args) + super().__init__(*args) self._builder = builder def __setitem__(self, key: str, value: str): @@ -814,13 +814,13 @@ def __setitem__(self, key: str, value: str): if not isinstance(value, str): raise TypeError("Type attribute value must be a string") core.BNSetTypeBuilderAttribute(self._builder._handle, key, value) - super(TypeBuilderAttributes, self).__setitem__(key, value) + super().__setitem__(key, value) def __delitem__(self, key: str): if not isinstance(key, str): raise TypeError("Type attribute key must be a string") core.BNRemoveTypeBuilderAttribute(self._builder._handle, key) - super(TypeBuilderAttributes, self).__delitem__(key) + super().__delitem__(key) class TypeBuilder: @@ -1780,7 +1780,7 @@ def __init__( self, handle: core.BNTypeBuilderHandle, builder_handle: core.BNStructureBuilderHandle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence ): - super(StructureBuilder, self).__init__(handle, platform, confidence) + super().__init__(handle, platform, confidence) assert builder_handle is not None, "Can't instantiate Structure with builder_handle set to None" self.builder_handle = builder_handle @@ -2028,7 +2028,7 @@ def __init__( self, handle: core.BNTypeBuilderHandle, enum_builder_handle: core.BNEnumerationBuilderHandle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence ): - super(EnumerationBuilder, self).__init__(handle, platform, confidence) + super().__init__(handle, platform, confidence) assert isinstance(enum_builder_handle, core.BNEnumerationBuilderHandle) self.enum_builder_handle = enum_builder_handle @@ -2155,7 +2155,7 @@ def __init__( assert isinstance( ntr_builder_handle, core.BNNamedTypeReferenceBuilderHandle ), "Failed to construct NameTypeReference" - super(NamedTypeReferenceBuilder, self).__init__(handle, platform, confidence) + super().__init__(handle, platform, confidence) self.ntr_builder_handle = ntr_builder_handle @classmethod @@ -2911,7 +2911,7 @@ def create(cls, platform: Optional['_platform.Platform'] = None, confidence: int class IntegerType(Type): def __init__(self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence): - super(IntegerType, self).__init__(handle, platform, confidence) + super().__init__(handle, platform, confidence) @classmethod def create( @@ -2957,7 +2957,7 @@ def create( class StructureType(Type): def __init__(self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence): assert handle is not None, "Attempted to create EnumerationType with handle which is None" - super(StructureType, self).__init__(handle, platform, confidence) + super().__init__(handle, platform, confidence) struct_handle = core.BNGetTypeStructure(handle) assert struct_handle is not None, "core.BNGetTypeStructure returned None" self.struct_handle = struct_handle @@ -2994,7 +2994,7 @@ def from_core_struct(cls, structure: core.BNStructure) -> 'StructureType': def __del__(self): if core is not None: core.BNFreeStructure(self.struct_handle) - super(StructureType, self).__del__() + super().__del__() def __hash__(self): return hash(ctypes.addressof(self.struct_handle.contents)) @@ -3234,7 +3234,7 @@ def children(self) -> List[Type]: class EnumerationType(IntegerType): def __init__(self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence): assert handle is not None, "Attempted to create EnumerationType without handle" - super(EnumerationType, self).__init__(handle, platform, confidence) + super().__init__(handle, platform, confidence) enum_handle = core.BNGetTypeEnumeration(handle) assert enum_handle is not None, "core.BNGetTypeEnumeration returned None" self.enum_handle = enum_handle @@ -3242,7 +3242,7 @@ def __init__(self, handle, platform: Optional['_platform.Platform'] = None, conf def __del__(self): if core is not None: core.BNFreeEnumeration(self.enum_handle) - super(EnumerationType, self).__del__() + super().__del__() def __hash__(self): return hash(ctypes.addressof(self.enum_handle.contents)) @@ -3622,7 +3622,7 @@ def __init__( self, handle, platform: Optional['_platform.Platform'] = None, confidence: int = core.max_confidence, ntr_handle=None ): assert handle is not None, "Attempting to create NamedTypeReferenceType handle which is None" - super(NamedTypeReferenceType, self).__init__(handle, platform, confidence) + super().__init__(handle, platform, confidence) if ntr_handle is None: ntr_handle = core.BNGetTypeNamedTypeReference(handle) assert ntr_handle is not None, "core.BNGetTypeNamedTypeReference returned None" @@ -3700,7 +3700,7 @@ def create_from_registered_type( def __del__(self): if core is not None: core.BNFreeNamedTypeReference(self.ntr_handle) - super(NamedTypeReferenceType, self).__del__() + super().__del__() def __repr__(self): if self.named_type_class == NamedTypeReferenceClass.TypedefNamedTypeClass: diff --git a/python/variable.py b/python/variable.py index b48615719..394696ddc 100644 --- a/python/variable.py +++ b/python/variable.py @@ -969,7 +969,7 @@ def __init__( self, arch: 'binaryninja.architecture.Architecture', source_type: VariableSourceType, index: int, storage: int ): - super(ArchitectureVariable, self).__init__(int(source_type), index, storage) + super().__init__(int(source_type), index, storage) self._arch = arch @property @@ -1067,7 +1067,7 @@ class Variable(CoreVariable): in medium level IL, so variables objects are only valid for MLIL and above. """ def __init__(self, func: FunctionOrILFunction, source_type: VariableSourceType, index: int, storage: int): - super(Variable, self).__init__(int(source_type), index, storage) + super().__init__(int(source_type), index, storage) if isinstance(func, binaryninja.function.Function): self._function = func self._il_function = None