mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
printobject now returns an error code
Remove superfluous err_nomem() call ,
This commit is contained in:
parent
bcaa31c411
commit
49e85146e2
1 changed files with 7 additions and 6 deletions
|
@ -116,7 +116,7 @@ tupledealloc(op)
|
||||||
free((ANY *)op);
|
free((ANY *)op);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
tupleprint(op, fp, flags)
|
tupleprint(op, fp, flags)
|
||||||
tupleobject *op;
|
tupleobject *op;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -124,15 +124,16 @@ tupleprint(op, fp, flags)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
fprintf(fp, "(");
|
fprintf(fp, "(");
|
||||||
for (i = 0; i < op->ob_size && !StopPrint; i++) {
|
for (i = 0; i < op->ob_size; i++) {
|
||||||
if (i > 0) {
|
if (i > 0)
|
||||||
fprintf(fp, ", ");
|
fprintf(fp, ", ");
|
||||||
}
|
if (printobject(op->ob_item[i], fp, flags) != 0)
|
||||||
printobject(op->ob_item[i], fp, flags);
|
return -1;
|
||||||
}
|
}
|
||||||
if (op->ob_size == 1)
|
if (op->ob_size == 1)
|
||||||
fprintf(fp, ",");
|
fprintf(fp, ",");
|
||||||
fprintf(fp, ")");
|
fprintf(fp, ")");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
object *
|
object *
|
||||||
|
@ -243,7 +244,7 @@ tupleconcat(a, bb)
|
||||||
size = a->ob_size + b->ob_size;
|
size = a->ob_size + b->ob_size;
|
||||||
np = (tupleobject *) newtupleobject(size);
|
np = (tupleobject *) newtupleobject(size);
|
||||||
if (np == NULL) {
|
if (np == NULL) {
|
||||||
return err_nomem();
|
return NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < a->ob_size; i++) {
|
for (i = 0; i < a->ob_size; i++) {
|
||||||
object *v = a->ob_item[i];
|
object *v = a->ob_item[i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue