From 232fcbe499199acdf0777e2c01cca401b40f355b Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sat, 27 Jun 2020 22:16:57 +0100 Subject: [PATCH] Objects: Go back to the *much* quicker exception handling --- volatility/framework/interfaces/objects.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/volatility/framework/interfaces/objects.py b/volatility/framework/interfaces/objects.py index 266231fe6..d3b27e091 100644 --- a/volatility/framework/interfaces/objects.py +++ b/volatility/framework/interfaces/objects.py @@ -6,7 +6,6 @@ interpreted values of data from a layer.""" import abc import collections import collections.abc -import contextlib import logging from abc import ABCMeta, abstractmethod from typing import Any, Dict, List, Mapping, Optional @@ -184,9 +183,12 @@ class ObjectInterface(metaclass = ABCMeta): member_name: Name of the member to test access to determine if the member is valid or not """ if self.has_member(member_name): - with contextlib.suppress(Exception): + # noinspection PyBroadException + try: _ = getattr(self, member_name) return True + except Exception: + pass return False def has_valid_members(self, member_names: List[str]) -> bool: