mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-31 04:09:40 +02:00
Renderers: Fix python deprecation warnings
This commit is contained in:
@@ -9,9 +9,9 @@ renderer interface which can interact with a TreeGrid to produce
|
||||
suitable output.
|
||||
"""
|
||||
|
||||
import collections
|
||||
import datetime
|
||||
from abc import abstractmethod, ABCMeta
|
||||
from collections import abc
|
||||
from typing import Any, Callable, ClassVar, Generator, Iterable, List, NamedTuple, Optional, TypeVar, Type, Tuple, Union
|
||||
|
||||
Column = NamedTuple('Column', [('name', str), ('type', Any)])
|
||||
@@ -46,7 +46,7 @@ class ColumnSortKey(metaclass = ABCMeta):
|
||||
function."""
|
||||
|
||||
|
||||
class TreeNode(collections.Sequence, metaclass = ABCMeta):
|
||||
class TreeNode(abc.Sequence, metaclass = ABCMeta):
|
||||
|
||||
def __init__(self, path, treegrid, parent, values):
|
||||
"""Initializes the TreeNode."""
|
||||
|
||||
@@ -9,6 +9,7 @@ or file or graphical output
|
||||
import collections
|
||||
import datetime
|
||||
import logging
|
||||
from collections import abc
|
||||
from typing import Any, Callable, Iterable, List, Optional, Tuple, TypeVar, Union
|
||||
|
||||
from volatility.framework import interfaces
|
||||
@@ -70,7 +71,7 @@ class TreeNode(interfaces.renderers.TreeNode):
|
||||
def _validate_values(self, values: List[interfaces.renderers.BaseTypes]) -> None:
|
||||
"""A function for raising exceptions if a given set of values is
|
||||
invalid according to the column properties."""
|
||||
if not (isinstance(values, collections.Sequence) and len(values) == len(self._treegrid.columns)):
|
||||
if not (isinstance(values, abc.Sequence) and len(values) == len(self._treegrid.columns)):
|
||||
raise TypeError(
|
||||
"Values must be a list of objects made up of simple types and number the same as the columns")
|
||||
for index in range(len(self._treegrid.columns)):
|
||||
|
||||
Reference in New Issue
Block a user