Fix refcount error and use cythons <bytes> to convert a python object to char*

This commit is contained in:
hofmockel 2014-01-15 09:53:27 +01:00
parent 29551902e7
commit b4fb12589d

View file

@ -289,10 +289,11 @@ cdef cpp_bool merge_callback(
return False return False
except Exception: except Exception:
tb = traceback.format_exc()
logger.Log( logger.Log(
log, log,
"Error in merge_callback: %s", "Error in merge_callback: %s",
PyString_AsString(traceback.format_exc())) <bytes>tb)
return False return False
cdef cpp_bool full_merge_callback( cdef cpp_bool full_merge_callback(
@ -322,10 +323,11 @@ cdef cpp_bool full_merge_callback(
return False return False
except Exception: except Exception:
tb = traceback.format_exc()
logger.Log( logger.Log(
log, log,
"Error in full_merge_callback: %s", "Error in full_merge_callback: %s",
PyString_AsString(traceback.format_exc())) <bytes>tb)
return False return False
cdef cpp_bool partial_merge_callback( cdef cpp_bool partial_merge_callback(
@ -350,10 +352,11 @@ cdef cpp_bool partial_merge_callback(
return False return False
except Exception: except Exception:
tb = traceback.format_exc()
logger.Log( logger.Log(
log, log,
"Error in partial_merge_callback: %s", "Error in partial_merge_callback: %s",
PyString_AsString(traceback.format_exc())) <bytes>tb)
return False return False
############################################## ##############################################