Python-EFL: whoops, fix last commit to work with py3

This commit is contained in:
Davide Andreoli 2014-02-27 22:48:22 +01:00
parent 32448918f6
commit b04147b5f3
1 changed files with 4 additions and 2 deletions

View File

@ -96,12 +96,14 @@ cdef char * _multibuttonentry_format_cb(int count, void *data) with gil:
(callback, a, ka) = <object>data (callback, a, ka) = <object>data
try: try:
ret = callback(count, *a, **ka) s = callback(count, *a, **ka)
if isinstance(s, unicode): s = PyUnicode_AsUTF8String(s)
except: except:
traceback.print_exc() traceback.print_exc()
return NULL
# TODO leak here # TODO leak here
return strdup(ret) return strdup(<char *>s)
cdef class MultiButtonEntryItem(ObjectItem): cdef class MultiButtonEntryItem(ObjectItem):