diff --git a/volatility/framework/interfaces/renderers.py b/volatility/framework/interfaces/renderers.py index 7e2356db0..2193d2731 100644 --- a/volatility/framework/interfaces/renderers.py +++ b/volatility/framework/interfaces/renderers.py @@ -78,7 +78,7 @@ class TreeGrid(object, metaclass = ABCMeta): and to create cycles. """ - simple_types = set([int, str, float, bytes]) + simple_types = {int, str, float, bytes} def __init__(self, columns, generator): """Constructs a TreeGrid object using a specific set of columns @@ -129,7 +129,8 @@ class TreeGrid(object, metaclass = ABCMeta): def max_depth(self): """Returns the maximum depth of the tree""" - def path_depth(self, node): + @staticmethod + def path_depth(node): """Returns the path depth of a particular node""" return node.path_depth diff --git a/volatility/framework/interfaces/symbols.py b/volatility/framework/interfaces/symbols.py index 9b97ba6aa..0ce0c429a 100644 --- a/volatility/framework/interfaces/symbols.py +++ b/volatility/framework/interfaces/symbols.py @@ -15,7 +15,7 @@ class SymbolTableInterface(validity.ValidityRoutines): if name: self._type_check(name, str) self.name = name or None - self.natives = native_structures + self.native_structures = native_structures # ## Required Constant symbol functions diff --git a/volatility/framework/renderers/__init__.py b/volatility/framework/renderers/__init__.py index 5acc05a66..5fdf7346d 100644 --- a/volatility/framework/renderers/__init__.py +++ b/volatility/framework/renderers/__init__.py @@ -125,7 +125,8 @@ class TreeGrid(interfaces.renderers.TreeGrid): self._generator = generator - def _sanitize(self, text): + @staticmethod + def _sanitize(text): output = "" for letter in text.lower(): if letter != ' ': diff --git a/volatility/framework/symbols/native.py b/volatility/framework/symbols/native.py index f68a82c2d..da807de75 100644 --- a/volatility/framework/symbols/native.py +++ b/volatility/framework/symbols/native.py @@ -20,7 +20,7 @@ class NativeTable(interfaces.symbols.NativeTableInterface): self._overrides[native_type] = native_class # Create this once early, because it may get used a lot self._structures = set(self._native_dictionary).union( - set(['Enumeration', 'array', 'BitField', 'void', 'pointer'])) + {'Enumeration', 'array', 'BitField', 'void', 'pointer'}) def get_structure_class(self, name): ntype, fmt = native_types.get(name, (objects.Integer, '')) diff --git a/volatility/framework/symbols/windows/__init__.py b/volatility/framework/symbols/windows/__init__.py index 31fb49423..b18fef493 100644 --- a/volatility/framework/symbols/windows/__init__.py +++ b/volatility/framework/symbols/windows/__init__.py @@ -28,7 +28,7 @@ class _LIST_ENTRY(objects.Struct, collections.abc.Iterable): if not sentinel: yield self._context.object(structure, layer, offset = self.vol.offset - relative_offset) - seen = set([self.vol.offset]) + seen = {self.vol.offset} while link.vol.offset not in seen: obj = self._context.object(structure, layer, offset = link.vol.offset - relative_offset)