From 0b781cb19b791f8138963c24c7416b04a340ec2d Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 24 Nov 2013 13:29:56 +0100 Subject: [PATCH] Consistency! --- pythonwhois/parse.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pythonwhois/parse.py b/pythonwhois/parse.py index c8d3c99..daca3cf 100644 --- a/pythonwhois/parse.py +++ b/pythonwhois/parse.py @@ -218,6 +218,12 @@ def parse_raw_whois(raw_data, normalized=[]): data['emails'] = [email for email in data["emails"] if email not in known_emails] except KeyError, e: pass # Not present + + try: + if len(data['emails']) == 0: + del data['emails'] + except KeyError, e: + pass data["raw"] = raw_data