This is an archive of the discontinued LLVM Phabricator instance.

[hmaptool] Port to python3
ClosedPublic

Authored by lanza on Aug 11 2021, 8:48 PM.

Details

Summary

This is just a few trivial changes -- change the interpreter and fix a
few byte-vs-string issues.

Diff Detail

Event Timeline

lanza requested review of this revision.Aug 11 2021, 8:48 PM
lanza created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2021, 8:48 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
lanza added a reviewer: bruno.Aug 11 2021, 8:51 PM
bruno added a comment.Oct 12 2021, 6:38 PM

Overall looks great but there are some test failures, looks like you also need to update line 223?

--
Traceback (most recent call last):
  File "/var/lib/buildkite-agent/builds/llvm-project/build/bin/hmaptool", line 296, in <module>
    main()
  File "/var/lib/buildkite-agent/builds/llvm-project/build/bin/hmaptool", line 293, in main
    commands[cmd](cmd, sys.argv[2:])
  File "/var/lib/buildkite-agent/builds/llvm-project/build/bin/hmaptool", line 223, in action_write
    f.write(magic.encode())
AttributeError: 'bytes' object has no attribute 'encode'
--
ivanmurashko added inline comments.
clang/utils/hmaptool/hmaptool
224

magic is a bytes object that does not have encode() method

lanza updated this revision to Diff 388568.Nov 19 2021, 11:09 AM
lanza marked an inline comment as done.
bruno accepted this revision.Nov 19 2021, 3:28 PM

LGTM!

This revision is now accepted and ready to land.Nov 19 2021, 3:28 PM
This revision was automatically updated to reflect the committed changes.