From 64619758ab16cca25ed04105375a1e8522dc7067 Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Wed, 13 Nov 2013 21:14:46 -0800 Subject: [PATCH] Fix bug in python3 due to improper string handling --- capnp/capnp.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capnp/capnp.pyx b/capnp/capnp.pyx index 20f902c..6200410 100644 --- a/capnp/capnp.pyx +++ b/capnp/capnp.pyx @@ -208,9 +208,9 @@ cdef public object wrap_kj_exception_for_reraise(capnp.Exception & exception): cdef public object get_exception_info(object exc_type, object exc_obj, object exc_tb): try: - return (exc_tb.tb_frame.f_code.co_filename, exc_tb.tb_lineno, repr(exc_type) + ':' + str(exc_obj)) + return (exc_tb.tb_frame.f_code.co_filename.encode(), exc_tb.tb_lineno, (repr(exc_type) + ':' + str(exc_obj)).encode()) except: - return ('', 0, "Couldn't determine python exception") + return (b'', 0, b"Couldn't determine python exception") ctypedef fused _DynamicStructReaderOrBuilder: