summaryrefslogtreecommitdiff
path: root/python/basicblock.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-09-24 09:20:23 -0400
committerPeter LaFosse <peter@vector35.com>2021-09-24 09:40:16 -0400
commit5a288649e8fcb999c11cca17ad0c1956f3ef8e11 (patch)
tree7d9df04c7ffaa25d6192cfd09f3e48c2b06054a7 /python/basicblock.py
parentad16e8b3d27e30cc4eefb7c673f7646a30fe2f26 (diff)
Use more f-strings
Diffstat (limited to 'python/basicblock.py')
-rw-r--r--python/basicblock.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/basicblock.py b/python/basicblock.py
index 872e44b8..3854ffd5 100644
--- a/python/basicblock.py
+++ b/python/basicblock.py
@@ -64,9 +64,9 @@ class BasicBlock:
def __repr__(self):
arch = self.arch
if arch:
- return "<block: %s@%#x-%#x>" % (arch.name, self.start, self.end)
+ return f"<block: {arch.name}@{self.start:#x}-{self.end:#x}>"
else:
- return "<block: %#x-%#x>" % (self.start, self.end)
+ return f"<block: {self.start:#x}-{self.end:#x}>"
def __len__(self):
return int(core.BNGetBasicBlockLength(self.handle))
@@ -88,7 +88,7 @@ class BasicBlock:
try:
object.__setattr__(self, name, value)
except AttributeError:
- raise AttributeError("attribute '%s' is read only" % name)
+ raise AttributeError(f"attribute '{name}' is read only")
def __iter__(self) -> Generator[Tuple[List['_function.InstructionTextToken'], int], None, None]:
if self.arch is None: