From 13822c9a2d220d4a76e5d39b585a3c57024bb665 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 30 Sep 2013 10:25:39 +0000 Subject: better handling for nonExist in the C runtime. BIND is also supported in the linearizer but not in the parser yet --- src/runtime/python/pypgf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/runtime/python/pypgf.c') diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index b5ff53af0..a76344ca7 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -1378,8 +1378,12 @@ Concr_linearize(ConcrObject* self, PyObject *args) pgf_linearize(self->concr, pyexpr->expr, out, err); if (!gu_ok(err)) { - PyErr_SetString(PGFError, "The abstract tree cannot be linearized"); - return NULL; + if (gu_exn_caught(err) == gu_type(PgfLinNonExist)) + Py_RETURN_NONE; + else { + PyErr_SetString(PGFError, "The abstract tree cannot be linearized"); + return NULL; + } } GuString str = gu_string_buf_freeze(sbuf, tmp_pool); -- cgit v1.2.3