THRIFT-3613 Port Python C extension to Python 3
Client: Python
Patch: Nobuaki Sukegawa
This closes #845
diff --git a/lib/py/src/compat.py b/lib/py/src/compat.py
index 42403ea..787149a 100644
--- a/lib/py/src/compat.py
+++ b/lib/py/src/compat.py
@@ -34,13 +34,7 @@
from io import BytesIO as BufferIO
def binary_to_str(bin_val):
- try:
- return bin_val.decode('utf8')
- except:
- return bin_val
+ return bin_val.decode('utf8')
def str_to_binary(str_val):
- try:
- return bytes(str_val, 'utf8')
- except:
- return str_val
+ return bytes(str_val, 'utf8')