@@ -977,8 +977,8 @@ _textiowrapper_fix_encoder_state(textio *self)
977
977
978
978
if (cmp == 0 ) {
979
979
self -> encoding_start_of_stream = 0 ;
980
- PyObject * res = PyObject_CallMethodObjArgs (
981
- self -> encoder , _PyIO_str_setstate , _PyLong_Zero , NULL );
980
+ PyObject * res = _PyObject_CallMethodOneArg (
981
+ self -> encoder , _PyIO_str_setstate , _PyLong_Zero );
982
982
if (res == NULL ) {
983
983
return -1 ;
984
984
}
@@ -1155,8 +1155,8 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
1155
1155
PyObject * locale_module = _PyIO_get_locale_module (state );
1156
1156
if (locale_module == NULL )
1157
1157
goto catch_ImportError ;
1158
- self -> encoding = _PyObject_CallMethodIdObjArgs (
1159
- locale_module , & PyId_getpreferredencoding , Py_False , NULL );
1158
+ self -> encoding = _PyObject_CallMethodIdOneArg (
1159
+ locale_module , & PyId_getpreferredencoding , Py_False );
1160
1160
Py_DECREF (locale_module );
1161
1161
if (self -> encoding == NULL ) {
1162
1162
catch_ImportError :
@@ -1597,8 +1597,7 @@ _textiowrapper_writeflush(textio *self)
1597
1597
1598
1598
PyObject * ret ;
1599
1599
do {
1600
- ret = PyObject_CallMethodObjArgs (self -> buffer ,
1601
- _PyIO_str_write , b , NULL );
1600
+ ret = _PyObject_CallMethodOneArg (self -> buffer , _PyIO_str_write , b );
1602
1601
} while (ret == NULL && _PyIO_trap_eintr ());
1603
1602
Py_DECREF (b );
1604
1603
if (ret == NULL )
@@ -1668,8 +1667,7 @@ _io_TextIOWrapper_write_impl(textio *self, PyObject *text)
1668
1667
self -> encoding_start_of_stream = 0 ;
1669
1668
}
1670
1669
else
1671
- b = PyObject_CallMethodObjArgs (self -> encoder ,
1672
- _PyIO_str_encode , text , NULL );
1670
+ b = _PyObject_CallMethodOneArg (self -> encoder , _PyIO_str_encode , text );
1673
1671
1674
1672
Py_DECREF (text );
1675
1673
if (b == NULL )
@@ -1851,9 +1849,9 @@ textiowrapper_read_chunk(textio *self, Py_ssize_t size_hint)
1851
1849
if (chunk_size == NULL )
1852
1850
goto fail ;
1853
1851
1854
- input_chunk = PyObject_CallMethodObjArgs (self -> buffer ,
1852
+ input_chunk = _PyObject_CallMethodOneArg (self -> buffer ,
1855
1853
(self -> has_read1 ? _PyIO_str_read1 : _PyIO_str_read ),
1856
- chunk_size , NULL );
1854
+ chunk_size );
1857
1855
Py_DECREF (chunk_size );
1858
1856
if (input_chunk == NULL )
1859
1857
goto fail ;
@@ -2414,8 +2412,8 @@ _textiowrapper_encoder_reset(textio *self, int start_of_stream)
2414
2412
self -> encoding_start_of_stream = 1 ;
2415
2413
}
2416
2414
else {
2417
- res = PyObject_CallMethodObjArgs (self -> encoder , _PyIO_str_setstate ,
2418
- _PyLong_Zero , NULL );
2415
+ res = _PyObject_CallMethodOneArg (self -> encoder , _PyIO_str_setstate ,
2416
+ _PyLong_Zero );
2419
2417
self -> encoding_start_of_stream = 0 ;
2420
2418
}
2421
2419
if (res == NULL )
@@ -2554,8 +2552,7 @@ _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence)
2554
2552
posobj = PyLong_FromOff_t (cookie .start_pos );
2555
2553
if (posobj == NULL )
2556
2554
goto fail ;
2557
- res = PyObject_CallMethodObjArgs (self -> buffer ,
2558
- _PyIO_str_seek , posobj , NULL );
2555
+ res = _PyObject_CallMethodOneArg (self -> buffer , _PyIO_str_seek , posobj );
2559
2556
Py_DECREF (posobj );
2560
2557
if (res == NULL )
2561
2558
goto fail ;
@@ -2837,7 +2834,7 @@ _io_TextIOWrapper_tell_impl(textio *self)
2837
2834
}
2838
2835
2839
2836
finally :
2840
- res = _PyObject_CallMethodIdObjArgs (self -> decoder , & PyId_setstate , saved_state , NULL );
2837
+ res = _PyObject_CallMethodIdOneArg (self -> decoder , & PyId_setstate , saved_state );
2841
2838
Py_DECREF (saved_state );
2842
2839
if (res == NULL )
2843
2840
return NULL ;
@@ -2851,7 +2848,7 @@ _io_TextIOWrapper_tell_impl(textio *self)
2851
2848
if (saved_state ) {
2852
2849
PyObject * type , * value , * traceback ;
2853
2850
PyErr_Fetch (& type , & value , & traceback );
2854
- res = _PyObject_CallMethodIdObjArgs (self -> decoder , & PyId_setstate , saved_state , NULL );
2851
+ res = _PyObject_CallMethodIdOneArg (self -> decoder , & PyId_setstate , saved_state );
2855
2852
_PyErr_ChainExceptions (type , value , traceback );
2856
2853
Py_DECREF (saved_state );
2857
2854
Py_XDECREF (res );
@@ -2878,7 +2875,7 @@ _io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos)
2878
2875
return NULL ;
2879
2876
Py_DECREF (res );
2880
2877
2881
- return PyObject_CallMethodObjArgs (self -> buffer , _PyIO_str_truncate , pos , NULL );
2878
+ return _PyObject_CallMethodOneArg (self -> buffer , _PyIO_str_truncate , pos );
2882
2879
}
2883
2880
2884
2881
static PyObject *
@@ -3055,9 +3052,9 @@ _io_TextIOWrapper_close_impl(textio *self)
3055
3052
else {
3056
3053
PyObject * exc = NULL , * val , * tb ;
3057
3054
if (self -> finalizing ) {
3058
- res = _PyObject_CallMethodIdObjArgs (self -> buffer ,
3059
- & PyId__dealloc_warn ,
3060
- self , NULL );
3055
+ res = _PyObject_CallMethodIdOneArg (self -> buffer ,
3056
+ & PyId__dealloc_warn ,
3057
+ ( PyObject * ) self );
3061
3058
if (res )
3062
3059
Py_DECREF (res );
3063
3060
else
0 commit comments