From 94c9a42b728d6f0afabacbc225f50329dfdda39f Mon Sep 17 00:00:00 2001 From: Narbeh Arakil Date: Wed, 9 Dec 2020 18:05:54 +0330 Subject: [PATCH] Fix Module Import --- ssl_checker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ssl_checker.py b/ssl_checker.py index e14aa86..58857e2 100755 --- a/ssl_checker.py +++ b/ssl_checker.py @@ -274,6 +274,10 @@ class SSLChecker: if user_args.html_true: self.export_html(context) + # While using the script as a module + if __name__ != '__main__': + return json.dumps(context) + # Enable JSON output if -j/--json argument specified if user_args.json_true: print(json.dumps(context))