grit: c_format: use %o to avoid weird parsing
We're running an integer through oct() to get a string of the octal number, which we then pass to int() to parse as a decimal number so we can finally pass to %d to get a padded string. 195 -> '0303' -> 303 -> '303' This relies on the exact output format of oct() which breaks when using Python 3 -- it outputs '0o303' which int() rejects. We can simplify this greatly by just switching from %d to %o and letting Python do the translation for us. Bug: 983071 Test: `./grit/test_suite_all.py` passes Change-Id: I9c379d0962819e69eed2890bc2369784c0a95ef3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1755384Reviewed-by:Robert Flack <flackr@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Cr-Commit-Position: refs/heads/master@{#687255}
Showing
Please register or sign in to comment