From 0d9f4147b08be59e2f6dc98efce24942985a590b Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 30 May 2019 02:35:23 +0200 Subject: unnecessary else * remove unnecessary else clause --- main.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index d6ed2d3..efb3701 100755 --- a/main.py +++ b/main.py @@ -260,16 +260,15 @@ class AbuseReport: # return list sorted by priority and weight return sorted(results, key=lambda i: (i['priority'], i["weight"])) - else: - # prevent empty info when srv records are not present - info = dict() + # prevent empty info when srv records are not present + info = dict() - # gather necessary info from srv records - info["host"] = domain - info["ip"] = [ip.address for ip in dns.query(info["host"], "A")] - results.append(info) + # gather necessary info from srv records + info["host"] = domain + info["ip"] = [ip.address for ip in dns.query(info["host"], "A")] + results.append(info) - return results + return results if __name__ == "__main__": -- cgit v1.2.3-54-g00ecf