From fdbffee33cb4b23e711f669f82d51700370b5dd6 Mon Sep 17 00:00:00 2001
From: thebigbone <pacman@duck.com>
Date: Sun, 14 May 2023 11:29:16 +0530
Subject: [PATCH] check for import with single try

---
 analyze_hosts.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/analyze_hosts.py b/analyze_hosts.py
index b225898..de86cc5 100755
--- a/analyze_hosts.py
+++ b/analyze_hosts.py
@@ -27,15 +27,8 @@
 import time
 import warnings
 
-
 try:
     import nmap
-except ImportError:
-    print(
-        "[-] Please install python-nmap, e.g. pip3 install python-nmap", file=sys.stderr
-    )
-    sys.exit(-1)
-try:
     import requests
     import yaml
     import Wappalyzer
@@ -45,6 +38,7 @@
         file=sys.stderr,
     )
     sys.stderr.flush()
+    sys.exit(-1)
 
 # Workaround for https://github.com/chorsley/python-Wappalyzer/issues/40
 warnings.simplefilter("ignore")