Code cleanup: Dictionary creation could be rewritten as a dictionary literal

This commit is contained in:
Kai Huuhko 2014-04-14 01:12:49 +03:00
parent d65101b24b
commit 2c6f7253bb
1 changed files with 5 additions and 8 deletions

View File

@ -189,14 +189,11 @@ def _web_load_frame_error_conv(uintptr_t addr):
cdef Elm_Web_Frame_Load_Error *err = <Elm_Web_Frame_Load_Error *>addr cdef Elm_Web_Frame_Load_Error *err = <Elm_Web_Frame_Load_Error *>addr
if err == NULL: if err == NULL:
return None return None
ret = { ret = {"code": err.code, "is_cancellation": bool(err.is_cancellation),
"code": err.code, "domain": _ctouni(err.domain) if err.domain else None,
"is_cancellation": bool(err.is_cancellation), "description": _ctouni(err.description) if err.description else None,
} "failing_url": _ctouni(err.failing_url) if err.failing_url else None,
ret["domain"] = _ctouni(err.domain) if err.domain else None "frame": object_from_instance(err.frame) if err.frame else None}
ret["description"] = _ctouni(err.description) if err.description else None
ret["failing_url"] = _ctouni(err.failing_url) if err.failing_url else None
ret["frame"] = object_from_instance(err.frame) if err.frame else None
return ret return ret