mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
printobject now returns an error code
This commit is contained in:
parent
dd0108081b
commit
909336104b
10 changed files with 70 additions and 86 deletions
|
@ -117,17 +117,20 @@ file_dealloc(f)
|
|||
free((char *)f);
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
file_print(f, fp, flags)
|
||||
fileobject *f;
|
||||
FILE *fp;
|
||||
int flags;
|
||||
{
|
||||
fprintf(fp, "<%s file ", f->f_fp == NULL ? "closed" : "open");
|
||||
printobject(f->f_name, fp, flags);
|
||||
if (printobject(f->f_name, fp, flags) != 0)
|
||||
return -1;
|
||||
fprintf(fp, ", mode ");
|
||||
printobject(f->f_mode, fp, flags);
|
||||
if (printobject(f->f_mode, fp, flags) != 0)
|
||||
return -1;
|
||||
fprintf(fp, ">");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static object *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue