From 48d3432c9c604d3b23693b1263b486c83076643f Mon Sep 17 00:00:00 2001 From: Evgeny Tataurov Date: Sun, 26 Jan 2014 13:25:07 +0600 Subject: [PATCH] Fix device indexing for python3 --- pyicloud/services/findmyiphone.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyicloud/services/findmyiphone.py b/pyicloud/services/findmyiphone.py index 29cfb5e..60a98c0 100755 --- a/pyicloud/services/findmyiphone.py +++ b/pyicloud/services/findmyiphone.py @@ -58,7 +58,10 @@ class FindMyiPhoneServiceManager(object): def __getitem__(self, key): if isinstance(key, int): - key = self.keys()[key] + if six.PY3: + key = list(self.keys())[key] + else: + key = self.keys()[key] return self._devices[key] def __getattr__(self, attr):