Skip to content

Commit 9791ae5

Browse files
committed
Fix up direct import issue
1 parent 377697c commit 9791ae5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

volatility3/cli/text_renderer.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
import string
1010
import sys
1111
from functools import wraps
12-
from typing import Any, Callable, Dict, List, Tuple, TypeVar, Union
12+
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union
1313
from volatility3.cli import text_filter
1414

1515
from volatility3.framework import exceptions, interfaces, renderers
16-
from volatility3.framework.interfaces.renderers import BaseAbsentValue
1716
from volatility3.framework.renderers import format_hints
1817

1918
vollog = logging.getLogger(__name__)
@@ -84,7 +83,9 @@ def multitypedata_as_text(value: format_hints.MultiTypeData) -> str:
8483
T = TypeVar("T")
8584

8685

87-
def optional(func: Callable[[Union[BaseAbsentValue, T]], str]) -> Callable[[T], str]:
86+
def optional(
87+
func: Callable[[Union[interfaces.renderers.BaseAbsentValue, T]], str],
88+
) -> Callable[[T], str]:
8889
@wraps(func)
8990
def wrapped(x: Any) -> str:
9091
if isinstance(x, interfaces.renderers.BaseAbsentValue):
@@ -156,8 +157,10 @@ def __init__(self):
156157
self.display_hex = True
157158
self.display_ascii = True
158159

159-
def render(data: Union[renderers.LayerData, BaseAbsentValue]):
160-
if isinstance(data, BaseAbsentValue):
160+
def render(
161+
data: Union[renderers.LayerData, interfaces.renderers.BaseAbsentValue],
162+
):
163+
if isinstance(data, interfaces.renderers.BaseAbsentValue):
161164
# FIXME: Do something cleverer here
162165
return ""
163166

@@ -241,8 +244,8 @@ class CLIRenderer(interfaces.renderers.Renderer):
241244

242245
name = "unnamed"
243246
structured_output = False
244-
filter: text_filter.CLIFilter = None
245-
column_hide_list: list = None
247+
filter: Optional[text_filter.CLIFilter] = None
248+
column_hide_list: Optional[list] = None
246249

247250
def ignored_columns(
248251
self,

0 commit comments

Comments
 (0)