summaryrefslogtreecommitdiff
path: root/src/runtime/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/python')
-rw-r--r--src/runtime/python/pypgf.c8
1 files changed, 6 insertions, 2 deletions
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);