From 5339ebdef335ae994174c1d7ad92c86dc6bb1239 Mon Sep 17 00:00:00 2001 From: Tian Qiao Date: Tue, 7 Sep 2021 14:38:52 +0800 Subject: [PATCH] fix(): typo --- pocsuite3/lib/core/register.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pocsuite3/lib/core/register.py b/pocsuite3/lib/core/register.py index 5166c32d..d9ab98c2 100644 --- a/pocsuite3/lib/core/register.py +++ b/pocsuite3/lib/core/register.py @@ -56,7 +56,10 @@ def check_requires(data): if not import_name: import_name = install_name __import__(import_name) - ver = pkg_resources.get_distribution(import_name).version + try: + ver = pkg_resources.get_distribution(install_name).version + except Exception: + ver = 'unknown' logger.info(f'{install_name}=={ver} has been installed') except ImportError: err_msg = f'{install_name} not found, try install with "python -m pip install {install_name}"'