Check errors returned by recursive call to Split().

This commit is contained in:
Guido van Rossum 1996-12-17 01:02:18 +00:00
parent fc93f75da7
commit 0f868375ff
1 changed files with 11 additions and 4 deletions

View File

@ -261,13 +261,20 @@ Split (self, list)
v = PyString_FromString ("");
else if (argc == 1)
v = PyString_FromString (argv[0]);
else
else if ((v = PyTuple_New (argc)) != NULL)
{
int i;
PyObject *w;
v = PyTuple_New (argc);
for (i = 0; i < argc; i++)
PyTuple_SetItem (v, i, Split (self, argv[i]));
for (i = 0; i < argc; i++) {
if ((w = Split (self, argv[i])) == NULL)
{
Py_DECREF(v);
v = NULL;
break;
}
PyTuple_SetItem (v, i, w);
}
}
ckfree (FREECAST argv);