# HG changeset patch # User Evgeni Kunev # Date 1407837262 -10800 # Node ID 0ebff1cb6c75031618c2e4e9818ccffe43b335f5 # Parent 1ebe960587b1cd96eaccc89da1df26c90cd3f0d6 Raise AttributeError instead of KeyError This way it's possible to use `getattr` diff -r 1ebe960587b1 -r 0ebff1cb6c75 whois/parser.py --- a/whois/parser.py Tue Aug 12 12:51:51 2014 +0300 +++ b/whois/parser.py Tue Aug 12 12:54:22 2014 +0300 @@ -92,7 +92,7 @@ setattr(self, attr, values) return getattr(self, attr) else: - raise KeyError('Unknown attribute: %s' % attr) + raise AttributeError('Unknown attribute: %s' % attr) def __str__(self): """Print all whois properties of domain