1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-06 03:50:08 +02:00

do some string conversions less hackish and address one review comment on how to call the callback and return results

This commit is contained in:
holger krekel 2018-09-06 16:28:27 +02:00
parent aab06cda70
commit 1ff06c071b
4 changed files with 56 additions and 23 deletions

View file

@ -13,9 +13,10 @@ def py_dc_callback(ctx, evt, data1, data2):
looks up the correct event handler for the given context.
"""
callback = _DC_CALLBACK_MAP.get(ctx, lambda *a: 0)
ret = callback(ctx, evt, data1, data2)
if ret is None:
return 0
try:
ret = callback(ctx, evt, data1, data2)
except:
ret = 0
return ret