This is an archive of the discontinued LLVM Phabricator instance.

[opt-viewer] Use Python 3-compatible iteritems
ClosedPublic

Authored by modocache on Aug 11 2017, 10:21 AM.

Details

Summary

Replace a usage of a Python 2-specific dict.iteritems() with the
Python 3-compatible definition provided at the top of the same file.

Test Plan:
Run opt-viewer.py using Python 3 and confirm it no longer encounters a
runtime error when calling dict.iteritems().

Event Timeline

modocache created this revision.Aug 11 2017, 10:21 AM
anemet accepted this revision.Aug 11 2017, 10:29 AM

LGTM, sorry :(.

This revision is now accepted and ready to land.Aug 11 2017, 10:29 AM

Hey, no worries! I almost never catch Python 2/3 incompatibilities ahead of time. As I mentioned on PR34129, it'd be great to get some automated testing in place that could catch Python 2/3 errors as well, but until then I'm happy to fix these as I notice them.

Thanks for the review! :)

modocache closed this revision.Aug 11 2017, 11:02 AM