From 3e3a3a85baf4c8e75665f58c600fed3310b4441a Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Tue, 30 Jan 2018 15:22:50 +0000 Subject: [PATCH] Slightly clean-up magic import errors. --- volatility/framework/layers/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/volatility/framework/layers/__init__.py b/volatility/framework/layers/__init__.py index 4c44c2eee..8f63f2ad5 100644 --- a/volatility/framework/layers/__init__.py +++ b/volatility/framework/layers/__init__.py @@ -6,7 +6,6 @@ import logging import lzma import os import ssl -import sys import typing import urllib.parse import urllib.request @@ -15,7 +14,7 @@ import zipfile try: import magic except ImportError: - pass + magic = None try: import smb.SMBHandler @@ -94,7 +93,7 @@ class ResourceAccessor(object): # Determine whether the file is a particular type of file, and if so, open it as such IMPORTED_MAGIC = False - if 'magic' in sys.modules: + if not magic is None: while True: detected = None try: