From: Luis González Fernández Date: Thu, 5 May 2016 19:02:52 +0000 (+0200) Subject: Dictionary keys doesn't support slicing. That's throw an error in the program X-Git-Tag: v1.13.0~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F151%2Fhead;p=thirdparty%2Fdnspython.git Dictionary keys doesn't support slicing. That's throw an error in the program if the 'keyname' parameter is not passed. Doing a list(dict())[0] solve this problem. --- diff --git a/dns/message.py b/dns/message.py index 5f82b45a..1b310869 100644 --- a/dns/message.py +++ b/dns/message.py @@ -467,7 +467,7 @@ class Message(object): self.keyring = keyring if keyname is None: - self.keyname = self.keyring.keys()[0] + self.keyname = list(self.keyring.keys())[0] else: if isinstance(keyname, string_types): keyname = dns.name.from_text(keyname)