After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678497 - dict.iteritems() is no longer supported in Python 3
dict.iteritems() is no longer supported in Python 3
Status: RESOLVED FIXED
Product: pyatspi2
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Li Yuan
pyatspi2 maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-06-20 19:29 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2015-02-27 16:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (1.36 KB, patch)
2012-06-20 19:31 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2012-06-20 19:29:26 UTC
From http://docs.python.org/release/3.1.5/whatsnew/3.0.html#views-and-iterators-instead-of-lists:

"Also, the dict.iterkeys(), dict.iteritems() and dict.itervalues() methods are no longer supported."
Comment 1 Joanmarie Diggs (IRC: joanie) 2012-06-20 19:31:26 UTC
Created attachment 216866 [details] [review]
proposed fix
Comment 2 Mike Gorse 2012-06-20 22:04:32 UTC
Comment on attachment 216866 [details] [review]
proposed fix

Looks fine. Thanks.




>From b11d16bdc1ed52de4aea042fb7446249393cbcd7 Mon Sep 17 00:00:00 2001
>From: = <=>
>Date: Wed, 20 Jun 2012 15:26:40 -0400
>Subject: [PATCH] Fix for bug #678497 - dict.iteritems() is no longer
> supported in Python 3
>
>---
> pyatspi/document.py |    2 +-
> pyatspi/text.py     |    2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/pyatspi/document.py b/pyatspi/document.py
>index 8cb92e4..1ae2ddf 100644
>--- a/pyatspi/document.py
>+++ b/pyatspi/document.py
>@@ -58,7 +58,7 @@ class Document:
>                 as name-value pairs.
>                 """
>                 ret = Atspi.Document.get_attributes(self.obj)
>-                return [key + ':' + value for key, value in ret.iteritems()]
>+                return [key + ':' + value for key, value in ret.items()]
> 
>         def getLocale(self):
>                 """
>diff --git a/pyatspi/text.py b/pyatspi/text.py
>index a7806f8..a065d77 100644
>--- a/pyatspi/text.py
>+++ b/pyatspi/text.py
>@@ -288,7 +288,7 @@ class Text:
>                 but which were not explicitly specified by the content creator.
>                 """
>                 ret = Atspi.Text.get_default_attributes(self.obj)
>-                return ';'.join([key + ':' + value for key, value in ret.iteritems()])
>+                return ';'.join([key + ':' + value for key, value in ret.items()])
> 
>         def getNSelections(self):
>                 """
>-- 
>1.7.10.2
>
Comment 3 Joanmarie Diggs (IRC: joanie) 2012-06-20 22:28:05 UTC
Comment on attachment 216866 [details] [review]
proposed fix

Done. Thanks.

http://git.gnome.org/browse/pyatspi2/commit/?id=66efd36c30398e8ef283ec8a1495b93f974e854a
Comment 4 André Klapper 2015-02-27 16:40:57 UTC
[Moving at-spi/pyatspi2 bugs to separate product. See bug 740075]