diff --git a/gen_wrap.py b/gen_wrap.py index 17c0e896587658f9003b86f18ea81a97760b5684..86f135dcb46dcbe349fbe9dedd6abf2970fb7c6f 100644 --- a/gen_wrap.py +++ b/gen_wrap.py @@ -1297,7 +1297,8 @@ def write_method_wrapper(gen, cls_name, meth): post_call("_str_ret = None") if PY3: - ret_vals.insert(0, "_str_ret.decode()") + ret_vals.insert(0, + "_str_ret.decode() if _str_ret is not None else _str_ret") else: ret_vals.insert(0, "_str_ret")