From cf95f6e73e984600a5bd1470fc30b10e9b338275 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sat, 8 Dec 2018 18:41:13 +0000 Subject: [PATCH] Minor typing fix. --- volatility/framework/objects/utility.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/volatility/framework/objects/utility.py b/volatility/framework/objects/utility.py index b9df4fe10..62f1857be 100644 --- a/volatility/framework/objects/utility.py +++ b/volatility/framework/objects/utility.py @@ -55,11 +55,10 @@ def wintime_to_datetime(wintime: int) -> typing.Union[ except ValueError: return renderers.UnparsableValue() -def unixtime_to_datetime(unixtime: int) -> typing.Union[ - interfaces.renderers.BaseAbsentValue, datetime.datetime]: - ret = renderers.UnparsableValue() - +def unixtime_to_datetime(unixtime: int) -> typing.Union[interfaces.renderers.BaseAbsentValue, datetime.datetime]: + ret = renderers.UnparsableValue() # type: typing.Union[interfaces.renderers.BaseAbsentValue, datetime.datetime] + if unixtime > 0: try: ret = datetime.datetime.utcfromtimestamp(unixtime) @@ -68,6 +67,7 @@ def unixtime_to_datetime(unixtime: int) -> typing.Union[ return ret + def round(addr: int, align: int, up: bool = False) -> int: """Round an address up or down based on an alignment.