From d744250c1b585a829267ffdfe5ee3807dcb6fc16 Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 25 Jan 2019 02:40:45 -0500 Subject: [PATCH] pip.main moved to pip.__main (or something like that?) but don't try to use it anyways. --- ssl_tls/certparser.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/ssl_tls/certparser.py b/ssl_tls/certparser.py index 7372595..59b837c 100755 --- a/ssl_tls/certparser.py +++ b/ssl_tls/certparser.py @@ -17,26 +17,12 @@ import socket import ssl from urllib import parse # PyPi/PIP -# These are handled automagically. -# If you'd rather install them via your distro's package manager (YOU SHOULD), -# then install them first then run this script. -# Otherwise you'll have to use pip to remove them. -thrd_prty = {'OpenSSL': 'pyOpenSSL', - #'pyasn1': 'pyasn1', - #'jinja2': 'Jinja2', - 'validators': 'validators'} +import OpenSSL +import validators +#import pyasn1 cols = shutil.get_terminal_size((80, 20)).columns -for mod in thrd_prty: - try: - globals()[mod] = importlib.import_module(mod) - except ImportError: - import pip - pip.main(['install', '--quiet', '--quiet', '--quiet', - '--user', thrd_prty[mod]]) - globals()[mod] = importlib.import_module(mod) - class CertParse(object): def __init__(self, target, port = 443, force = None, cert_type = 'pem', json_fmt = False, starttls = False, extensions = False,