1
0
forked from GitHub/gf-core

Update behaviour for bindings to categoryContext when cat is non-existant

This commit is contained in:
John J. Camilleri
2021-09-13 22:44:04 +02:00
parent a715d029f7
commit 9e3d329528
2 changed files with 5 additions and 1 deletions

View File

@@ -1917,6 +1917,10 @@ PGF_categoryContext(PGFObject *self, PyObject *args)
return NULL;
}
if (hypos == NULL) {
Py_RETURN_NONE;
}
PyObject *contexts = PyList_New(n_hypos);
if (contexts == NULL) {
return NULL;

View File

@@ -98,7 +98,7 @@ def test_categoryContext_3(PGF):
assert tup[2] == pgf.readType("N")
def test_categoryContext_4(PGF):
assert PGF.categoryContext("X") == []
assert PGF.categoryContext("X") == None
def test_functionIsConstructor_1(PGF):
assert PGF.functionIsConstructor("s") == True