diff options
author | Mathieu Bridon <[email protected]> | 2018-06-17 14:44:46 +0200 |
---|---|---|
committer | Eric Engestrom <[email protected]> | 2018-08-01 14:26:19 +0100 |
commit | 12eb5b496bc311ebfd1e68921ec7429e709daaca (patch) | |
tree | 120e5818e1a9bd6f48b4ec98710d8bb01de2584d /src/compiler | |
parent | 9bd8b0f700255611e3eadf91a0f7bb037b6a2e64 (diff) |
python: Better get character ordinals
In Python 2, iterating over a byte-string yields single-byte strings,
and we can pass them to ord() to get the corresponding integer.
In Python 3, iterating over a byte-string directly yields those
integers.
Transforming the byte string into a bytearray gives us a list of the
integers corresponding to each byte in the string, removing the need to
call ord().
This makes the script compatible with both Python 2 and 3.
Signed-off-by: Mathieu Bridon <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/compiler')
0 files changed, 0 insertions, 0 deletions