From 5a288649e8fcb999c11cca17ad0c1956f3ef8e11 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Fri, 24 Sep 2021 09:20:23 -0400 Subject: Use more f-strings --- python/architecture.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'python/architecture.py') diff --git a/python/architecture.py b/python/architecture.py index db0c2a77..de28dc77 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -99,8 +99,8 @@ class IntrinsicInput: def __repr__(self): if len(self.name) == 0: - return "" % str(self.type) - return "" % (str(self.type), self.name) + return f"" + return f"" @dataclass(frozen=True) @@ -162,7 +162,7 @@ class _ArchitectureMetaClass(type): binaryninja._init_plugins() arch = core.BNGetArchitectureByName(name) if arch is None: - raise KeyError("'%s' is not a valid architecture" % str(name)) + raise KeyError(f"'{name}' is not a valid architecture") return CoreArchitecture._from_cache(arch) @@ -476,7 +476,7 @@ class Architecture(metaclass=_ArchitectureMetaClass): self._pending_type_lists = {} def __repr__(self): - return "" % self.name + return f"" def __eq__(self, other): if not isinstance(other, self.__class__): @@ -2390,7 +2390,7 @@ class CoreArchitecture(Architecture): if not core.BNAssemble(self.handle, code, addr, result.handle, errors): error_str = errors.value core.free_string(errors) - raise ValueError("Could not assemble: %s" % error_str) + raise ValueError(f"Could not assemble: {error_str}") return bytes(result) def is_never_branch_patch_available(self, data:bytes, addr:int=0) -> bool: -- cgit v1.3.1