7470: Upgrade to db version 17 fails in Python 3 due to use of iteritems
This commit is contained in:
parent
4fb98d5fbb
commit
08155ba962
@ -398,11 +398,6 @@ class FlatNodeMap(object):
|
|||||||
insert_pos = bisect.bisect_left(self._index2hndl, srtkey_hndl)
|
insert_pos = bisect.bisect_left(self._index2hndl, srtkey_hndl)
|
||||||
self._index2hndl.insert(insert_pos, srtkey_hndl)
|
self._index2hndl.insert(insert_pos, srtkey_hndl)
|
||||||
#make sure the index map is updated
|
#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():
|
for hndl, index in self._hndl2index.items():
|
||||||
if index >= insert_pos:
|
if index >= insert_pos:
|
||||||
self._hndl2index[hndl] += 1
|
self._hndl2index[hndl] += 1
|
||||||
@ -447,11 +442,6 @@ class FlatNodeMap(object):
|
|||||||
if self._reverse:
|
if self._reverse:
|
||||||
self.__corr = (len(self._index2hndl) - 1, -1)
|
self.__corr = (len(self._index2hndl) - 1, -1)
|
||||||
#update the handle2path map so it remains correct
|
#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():
|
for key, val in self._hndl2index.items():
|
||||||
if val > index:
|
if val > index:
|
||||||
self._hndl2index[key] -= 1
|
self._hndl2index[key] -= 1
|
||||||
|
@ -2400,7 +2400,7 @@ class GrampsParser(UpdateCallback):
|
|||||||
element_name = xml_element_name,
|
element_name = xml_element_name,
|
||||||
attrs = " ".join(
|
attrs = " ".join(
|
||||||
['{}="{}"'.format(k,escape(v, entities={'"' : """}))
|
['{}="{}"'.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,
|
# TRANSLATORS: leave the {date} and {xml} untranslated in the format string,
|
||||||
# but you may re-order them if needed.
|
# but you may re-order them if needed.
|
||||||
LOG.warning(_("Invalid date {date} in XML {xml}, preserving XML as text"
|
LOG.warning(_("Invalid date {date} in XML {xml}, preserving XML as text"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user