Skip to content

Commit 3cb2bf9

Browse files
committed
Core: Fix up python 3.10 support
Fixes #589
1 parent 23453f5 commit 3cb2bf9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

volatility3/framework/objects/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44

55
import collections
6+
import collections.abc
67
import logging
78
import struct
89
from typing import Any, ClassVar, Dict, List, Iterable, Optional, Tuple, Type, Union as TUnion, overload
@@ -633,7 +634,7 @@ def __len__(self) -> int:
633634
return self.vol.count
634635

635636
def write(self, value) -> None:
636-
if not isinstance(value, collections.Sequence):
637+
if not isinstance(value, collections.abc.Sequence):
637638
raise TypeError("Only Sequences can be written to arrays")
638639
self.count = len(value)
639640
for index in range(len(value)):

volatility3/framework/renderers/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
or file or graphical output
88
"""
99
import collections
10+
import collections.abc
1011
import datetime
1112
import logging
1213
from typing import Any, Callable, Iterable, List, Optional, Tuple, TypeVar, Union
@@ -70,7 +71,7 @@ def __len__(self) -> int:
7071
def _validate_values(self, values: List[interfaces.renderers.BaseTypes]) -> None:
7172
"""A function for raising exceptions if a given set of values is
7273
invalid according to the column properties."""
73-
if not (isinstance(values, collections.Sequence) and len(values) == len(self._treegrid.columns)):
74+
if not (isinstance(values, collections.abc.Sequence) and len(values) == len(self._treegrid.columns)):
7475
raise TypeError(
7576
"Values must be a list of objects made up of simple types and number the same as the columns")
7677
for index in range(len(self._treegrid.columns)):

0 commit comments

Comments
 (0)