From 873283e72d54f4661d3eff849269516c7dc18186 Mon Sep 17 00:00:00 2001 From: Benjamyn Date: Sun, 4 Feb 2018 19:35:15 -0500 Subject: [PATCH] Fixed --- main.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/main.py b/main.py index 3468438..4bfde3c 100644 --- a/main.py +++ b/main.py @@ -19,16 +19,18 @@ def splitLine(fileline): return tmpline def lookup(ip): - net = Net(ip) - obj = IPASN(net) - results = obj.lookup() - pprint(results) - for key,value in results.iteritems(): - if key == "asn_country_code": - print(value) - if key == "asn_cidr": - print(value) - + try: + net = Net(ip) + obj = IPASN(net) + results = obj.lookup() + pprint(results) + for key,value in results.iteritems(): + if key == "asn_country_code": + print(value) + if key == "asn_cidr": + print(value) + except Exception as e: + print(e) ipListFile = openFile("iplist.txt") ipList = ipListFile.read()