From 651e0ac827b8abe9773541986f4e6d529eca35ec Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Fri, 5 Nov 2021 13:23:39 +0000 Subject: [PATCH] Ignore plyvel (#1543) --- mythril/ethereum/interface/leveldb/eth_db.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mythril/ethereum/interface/leveldb/eth_db.py b/mythril/ethereum/interface/leveldb/eth_db.py index a296f696..1391c1a4 100644 --- a/mythril/ethereum/interface/leveldb/eth_db.py +++ b/mythril/ethereum/interface/leveldb/eth_db.py @@ -1,13 +1,23 @@ """This module contains the ETH_DB class, which the base database used by pyethereum.""" -import plyvel + from ethereum.db import BaseDB +has_plyvel = True +try: + import plyvel +except ImportError: + has_plyvel = False + class ETH_DB(BaseDB): """Adopts pythereum BaseDB using plyvel.""" def __init__(self, path): + if has_plyvel is False: + raise ImportError( + "Plyvel is not installed, please install plyvel and leveldb" + ) self.db = plyvel.DB(path) def get(self, key):