Skip to content

Commit 645a22e

Browse files
committed
As Neal pointed out, bool_print was an order of magnitude too complex.
1 parent b5080ab commit 645a22e

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

‎Objects/boolobject.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,7 @@
77
static int
88
bool_print(PyBoolObject *self, FILE *fp, int flags)
99
{
10-
if (flags & Py_PRINT_RAW) {
11-
if (self->ob_ival == 0)
12-
fputs("False", fp);
13-
else
14-
fputs("True", fp);
15-
}
16-
else {
17-
if (self->ob_ival == 0)
18-
fputs("False", fp);
19-
else
20-
fputs("True", fp);
21-
}
10+
fputs(self->ob_ival == 0 ? "False" : "True", fp);
2211
return 0;
2312
}
2413

0 commit comments

Comments
 (0)