Replace 'raise StopIteration' with a blank 'return', since changes in python-3.7 change StopIeration to a RuntimeError.

This commit is contained in:
Mike Auty
2018-09-28 12:44:19 +01:00
parent 3e176c8a50
commit de3bfad135
9 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -206,7 +206,7 @@ class Handles(interfaces_plugins.PluginInterface):
count = 0x1000 / subtype.size
if not self.context.memory[virtual].is_valid(offset):
raise StopIteration
return
table = ntkrnlmp.object(type_name = "array", offset = offset,
subtype = subtype, count = int(count))
@@ -248,7 +248,7 @@ class Handles(interfaces_plugins.PluginInterface):
table_levels = handle_table.TableCode & self._level_mask
except exceptions.PagedInvalidAddressException:
vollog.log(constants.LOGLEVEL_VVV, "Handle table parsing was aborted due to an invalid address exception")
raise StopIteration
return
for handle_table_entry in self._make_handle_array(TableCode, table_levels):
yield handle_table_entry
@@ -45,7 +45,7 @@ class PrintKey(plugins.PluginInterface):
node_path = [hive.get_node(hive.root_cell_offset)]
if not isinstance(node_path, list) or len(node_path) < 1:
vollog.warning("Hive walker was not passed a valid node_path (or None)")
raise StopIteration
return
node = node_path[-1]
key_path = key_path or node.get_key_path()
last_write_time = utility.wintime_to_datetime(node.LastWriteTime.QuadPart)
@@ -132,7 +132,7 @@ class UserAssist(interfaces_plugins.PluginInterface):
if not userassist_node_path:
vollog.warning("list_userassist did not find a valid node_path (or None)")
raise StopIteration
return
userassist_node = userassist_node_path[-1]
# iterate through the GUIDs under the userassist key
+1 -1
View File
@@ -45,7 +45,7 @@ class Strings(interfaces.plugins.PluginInterface):
yield (0, (str(string, 'latin-1'), format_hints.Hex(offset), ", ".join(revmap_list)))
except ValueError:
vollog.error("Strings file is in the wrong format")
raise StopIteration
return
def _parse_line(self, line: bytes) -> typing.Tuple[int, bytes]:
"""Parses a single line from a strings file"""