Skip to content

Commit

Permalink
tool: fixes for mypy
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Velickovic <[email protected]>
  • Loading branch information
Ivan-Velickovic committed Feb 14, 2024
1 parent 52aa6ad commit b63fc28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tool/microkit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from math import log2, ceil
from sys import argv, executable, stderr

from typing import Dict, List, Optional, Tuple, Union
from typing import Dict, List, Optional, Tuple, Union, cast

from microkit.elf import ElfFile
from microkit.util import kb, mb, lsb, msb, round_up, round_down, mask_bits, is_power_of_two, MemoryRegion, UserError
Expand Down Expand Up @@ -263,7 +263,7 @@ def invocation_to_str(inv: Sel4Invocation, cap_lookup: Dict[int, str]) -> str:
else:
val_str = f"{val} ({object_type_name} - 0x{object_size:x})"
elif nm == "regs":
regs = vars(inv.regs)
regs = vars(cast(Sel4TcbWriteRegisters, inv).regs)
val_str = ""
for i, reg in enumerate(regs.items()):
reg_value = 0 if reg[1] is None else reg[1]
Expand Down Expand Up @@ -594,7 +594,7 @@ class Region:
addr: int
data: bytearray

def __repr__(self):
def __repr__(self) -> str:
return f"<Region name={self.name} addr=0x{self.addr:x} size={len(self.data)}>"


Expand Down

0 comments on commit b63fc28

Please sign in to comment.