From c0a04d3552ed36a4b2db2cdd44aff81705405397 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 27 Jun 2015 21:18:24 -0500 Subject: [PATCH] Fix error when string returned as NULL in Py3 --- gen_wrap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gen_wrap.py b/gen_wrap.py index 17c0e89..86f135d 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") -- GitLab