Skip to content
Snippets Groups Projects
Commit 12eb5b49 authored by Mathieu Bridon's avatar Mathieu Bridon Committed by Eric Engestrom
Browse files

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: default avatarMathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: default avatarEric Engestrom <eric.engestrom@intel.com>
parent 9bd8b0f7
No related branches found
Tags mesa-17.1.0
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment