This is an archive of the discontinued LLVM Phabricator instance.

[utils] Fix incompatibility of bisect[-skip-count] with Python 3
ClosedPublic

Authored by miyuki on Sep 27 2019, 6:21 AM.

Details

Summary

This change replaces the print statements with print function calls
and also replaces the '/' operator (which is integer division in Py2,
but becomes floating point division in Py3) with the '//' operator
which has the same semantics in Py2 and Py3.

Diff Detail

Repository
rL LLVM

Event Timeline

miyuki created this revision.Sep 27 2019, 6:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2019, 6:21 AM

What happens when this is run with python 2 in the path? Should this explicitly run via python3?

miyuki added a comment.EditedSep 30 2019, 1:17 AM

What happens when this is run with python 2 in the path? Should this explicitly run via python3?

No, the scripts are now compatible with both python 2 and 3, I've checked that.

greened accepted this revision.Sep 30 2019, 8:52 AM

LGTM.

This revision is now accepted and ready to land.Sep 30 2019, 8:52 AM

Should this use from __future__ import print_function to avoid someone accidentially printing arguments as a tuple?

greened requested changes to this revision.Sep 30 2019, 8:58 AM

The more I think about this, the more I do think this should use from __future__ import print_function.

This revision now requires changes to proceed.Sep 30 2019, 8:58 AM
miyuki updated this revision to Diff 222617.EditedOct 1 2019, 7:52 AM

Added from __future__ import print_function

greened accepted this revision.Oct 4 2019, 9:23 AM

LGTM, thanks!

This revision is now accepted and ready to land.Oct 4 2019, 9:23 AM
This revision was automatically updated to reflect the committed changes.