commit | 66a44c5d8d57bd0c2e2afd228a29b5bc679a6770 | [log] [tgz] |
---|---|---|
author | Neil Williams <neil@reddit.com> | Mon Aug 13 16:12:24 2018 -0700 |
committer | Aki Sukegawa <nsukeg@gmail.com> | Sat Sep 01 10:24:43 2018 +0900 |
tree | b8e114bb322b05217224926c866b21a01a7af27c | |
parent | 8de3749235db03c1d043c9f31dcbdc4c0fb011ea [diff] [blame] |
THRIFT-4621 Add THeader for Python Client: py
diff --git a/lib/py/src/compat.py b/lib/py/src/compat.py index 41bcf35..0e8271d 100644 --- a/lib/py/src/compat.py +++ b/lib/py/src/compat.py
@@ -29,6 +29,9 @@ def str_to_binary(str_val): return str_val + def byte_index(bytes_val, i): + return ord(bytes_val[i]) + else: from io import BytesIO as BufferIO # noqa @@ -38,3 +41,6 @@ def str_to_binary(str_val): return bytes(str_val, 'utf8') + + def byte_index(bytes_val, i): + return bytes_val[i]