Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 4064f917e935a559320235f6ef529424 > files > 3

cmusphinx3-0.8-13.fc18.src.rpm

--- ./python/_sphinx3module.c.orig	2008-12-31 21:20:42.000000000 -0700
+++ ./python/_sphinx3module.c	2012-02-16 09:49:01.943812352 -0700
@@ -203,7 +203,8 @@ sphinx3_get_hypothesis(PyObject *self, P
 	allphone = (cmd_ln_int32("-op_mode") == 1);
 
 	hypstr_obj = PyString_FromString(hypstr);
-	hypseg_obj = PyTuple_New(nhyps);
+	if ((hypseg_obj = PyTuple_New(nhyps)) == NULL)
+		return PyErr_NoMemory();
 	for (i = 0; i < nhyps; ++i) {
 		PyObject *seg_obj;
 		const char *wordstr;
@@ -228,7 +229,7 @@ sphinx3_get_hypothesis(PyObject *self, P
 		PyTuple_SET_ITEM(hypseg_obj, i, seg_obj);
 	}
 
-	return Py_BuildValue("(OO)", hypstr_obj, hypseg_obj);
+	return Py_BuildValue("(NN)", hypstr_obj, hypseg_obj);
 }
 
 static PyObject *