Skip to content

Commit e5c014a

Browse files
committed
Move null checks up a line
1 parent 593b0ea commit e5c014a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_io/textio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,21 +774,21 @@ static PyObject *
774774
buffer_callmethod_noargs(textio *self, PyObject *name)
775775
{
776776
PyObject *buffer = buffer_access_safe(self);
777-
778777
if (buffer == NULL) {
779778
return NULL;
780779
}
780+
781781
return PyObject_CallMethodNoArgs(buffer, name);
782782
}
783783

784784
static PyObject *
785785
buffer_callmethod_onearg(textio *self, PyObject *name, PyObject *arg)
786786
{
787787
PyObject *buffer = buffer_access_safe(self);
788-
789788
if (buffer == NULL) {
790789
return NULL;
791790
}
791+
792792
return PyObject_CallMethodOneArg(buffer, name, arg);
793793
}
794794

0 commit comments

Comments
 (0)