mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-28 12:34:53 +02:00
Merge pull request #1570 from volatilityfoundation/issues/explicit-version-check
Core: Move the python check somewhere it can't accidentally be removed
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
# Check the python version to ensure it's suitable
|
||||
import glob
|
||||
import sys
|
||||
from volatility3.framework import check_python_version as check_python_version
|
||||
import zipfile
|
||||
import importlib
|
||||
import inspect
|
||||
@@ -16,6 +15,17 @@ from typing import Any, Dict, Generator, List, Optional, Tuple, Type, TypeVar
|
||||
|
||||
from volatility3.framework import constants, interfaces
|
||||
|
||||
if (
|
||||
sys.version_info.major != constants.REQUIRED_PYTHON_VERSION[0]
|
||||
or sys.version_info.minor < constants.REQUIRED_PYTHON_VERSION[1]
|
||||
or (
|
||||
sys.version_info.minor == constants.REQUIRED_PYTHON_VERSION[1]
|
||||
and sys.version_info.micro < constants.REQUIRED_PYTHON_VERSION[2]
|
||||
)
|
||||
):
|
||||
raise RuntimeError(
|
||||
f"Volatility framework requires python version {'.'.join(str(x) for x in constants.REQUIRED_PYTHON_VERSION)} or greater"
|
||||
)
|
||||
|
||||
# ##
|
||||
#
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import sys
|
||||
|
||||
required_python_version = (3, 8, 0)
|
||||
if (
|
||||
sys.version_info.major != required_python_version[0]
|
||||
or sys.version_info.minor < required_python_version[1]
|
||||
or (
|
||||
sys.version_info.minor == required_python_version[1]
|
||||
and sys.version_info.micro < required_python_version[2]
|
||||
)
|
||||
):
|
||||
raise RuntimeError(
|
||||
f"Volatility framework requires python version {required_python_version[0]}.{required_python_version[1]}.{required_python_version[2]} or greater"
|
||||
)
|
||||
@@ -23,6 +23,8 @@ from volatility3.framework.constants._version import (
|
||||
VERSION_SUFFIX as VERSION_SUFFIX,
|
||||
)
|
||||
|
||||
REQUIRED_PYTHON_VERSION = (3, 8, 0)
|
||||
|
||||
PLUGINS_PATH = [
|
||||
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "plugins")),
|
||||
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "plugins")),
|
||||
|
||||
Reference in New Issue
Block a user