Core: Change all 3.5 type hints to variable annotations

This commit is contained in:
Mike Auty
2021-07-18 16:49:37 +01:00
parent 9f52a15734
commit 0d48261201
58 changed files with 150 additions and 147 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ class Lsmod(plugins.PluginInterface):
except exceptions.InvalidAddressException:
return []
seen = set() # type: Set
seen: Set = set()
while kmod != 0 and \
kmod not in seen and \
+1 -1
View File
@@ -52,7 +52,7 @@ class Psaux(plugins.PluginInterface):
task_name = utility.array_to_string(task.p_comm)
args = [] # type: List[bytes]
args: List[bytes] = []
while argc > 0:
try:
+2 -2
View File
@@ -124,7 +124,7 @@ class PsList(interfaces.plugins.PluginInterface):
proc = kernel.object_from_symbol(symbol_name = "allproc").lh_first
seen = {} # type: Dict[int, int]
seen: Dict[int, int] = {}
while proc is not None and proc.vol.offset != 0:
if proc.vol.offset in seen:
vollog.log(logging.INFO, "Recursive process list detected (a result of non-atomic acquisition).")
@@ -165,7 +165,7 @@ class PsList(interfaces.plugins.PluginInterface):
queue_entry = kernel.object_from_symbol(symbol_name = "tasks")
seen = {} # type: Dict[int, int]
seen: Dict[int, int] = {}
for task in queue_entry.walk_list(queue_entry, "tasks", "task"):
if task.vol.offset in seen:
vollog.log(logging.INFO, "Recursive process list detected (a result of non-atomic acquisition).")