Skip to content

Commit

Permalink
r.zonal.classes: python3 fix compatibility of dictionary iteritem() f…
Browse files Browse the repository at this point in the history
…unction
  • Loading branch information
Tais Grippa committed Jan 14, 2020
1 parent 1e907e8 commit 1428409
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grass7/raster/r.zonal.classes/r.zonal.classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def main():
modalclass_dict = {}
for ID in totals_dict:
# The trick was found here : https://stackoverflow.com/a/268285/8013239
mode = max(totals_dict[ID].iteritems(), key=operator.itemgetter(1))[0]
mode = max(iter(totals_dict[ID].items()), key=operator.itemgetter(1))[0]
if mode == '*': # If the mode is NULL values
modalclass_dict[ID] = 'NULL'
else:
Expand Down

0 comments on commit 1428409

Please sign in to comment.