diff --git a/gramps/gen/db/upgrade.py b/gramps/gen/db/upgrade.py index 972cae126..359c8f11b 100644 --- a/gramps/gen/db/upgrade.py +++ b/gramps/gen/db/upgrade.py @@ -290,7 +290,7 @@ def upgrade_datamap_17(datamap): new_srcattr_list = [] private = False from ..lib.srcattrtype import SrcAttributeType - for (key, value) in datamap.iteritems(): + for (key, value) in datamap.items(): the_type = SrcAttributeType(key).serialize() new_srcattr_list.append((private, the_type, value)) return new_srcattr_list diff --git a/gramps/gen/filters/rules/place/_hasplace.py b/gramps/gen/filters/rules/place/_hasplace.py index 613a40464..8c5527764 100644 --- a/gramps/gen/filters/rules/place/_hasplace.py +++ b/gramps/gen/filters/rules/place/_hasplace.py @@ -91,7 +91,7 @@ class HasPlace(Rule): """ Check each location for a match. """ - for place_type, field in self.TYPE2FIELD.iteritems(): + for place_type, field in self.TYPE2FIELD.items(): name = location.get(place_type, '') if not self.match_substring(field, name): return False diff --git a/gramps/gui/views/treemodels/flatbasemodel.py b/gramps/gui/views/treemodels/flatbasemodel.py index d2490253a..6b138e82d 100644 --- a/gramps/gui/views/treemodels/flatbasemodel.py +++ b/gramps/gui/views/treemodels/flatbasemodel.py @@ -398,14 +398,9 @@ class FlatNodeMap(object): insert_pos = bisect.bisect_left(self._index2hndl, srtkey_hndl) self._index2hndl.insert(insert_pos, srtkey_hndl) #make sure the index map is updated - if sys.version_info[0] < 3: - for hndl, index in self._hndl2index.iteritems(): - if index >= insert_pos: - self._hndl2index[hndl] += 1 - else: - for hndl, index in self._hndl2index.items(): - if index >= insert_pos: - self._hndl2index[hndl] += 1 + for hndl, index in self._hndl2index.items(): + if index >= insert_pos: + self._hndl2index[hndl] += 1 self._hndl2index[srtkey_hndl[1]] = insert_pos #update self.__corr so it remains correct if self._reverse: @@ -447,14 +442,9 @@ class FlatNodeMap(object): if self._reverse: self.__corr = (len(self._index2hndl) - 1, -1) #update the handle2path map so it remains correct - if sys.version_info[0] < 3: - for key, val in self._hndl2index.iteritems(): - if val > index: - self._hndl2index[key] -= 1 - else: - for key, val in self._hndl2index.items(): - if val > index: - self._hndl2index[key] -= 1 + for key, val in self._hndl2index.items(): + if val > index: + self._hndl2index[key] -= 1 return Gtk.TreePath((delpath,)) #------------------------------------------------------------------------- diff --git a/gramps/plugins/importer/importxml.py b/gramps/plugins/importer/importxml.py index c6cc622a4..8823195c9 100644 --- a/gramps/plugins/importer/importxml.py +++ b/gramps/plugins/importer/importxml.py @@ -2491,7 +2491,7 @@ class GrampsParser(UpdateCallback): element_name = xml_element_name, attrs = " ".join( ['{}="{}"'.format(k,escape(v, entities={'"' : """})) - for k,v in xml_attrs.iteritems()])) + for k,v in xml_attrs.items()])) # TRANSLATORS: leave the {date} and {xml} untranslated in the format string, # but you may re-order them if needed. LOG.warning(_("Invalid date {date} in XML {xml}, preserving XML as text"