@@ -1491,7 +1490,7 @@ array_array_fromfile_impl(arrayobject *self, PyObject *f, Py_ssize_t n)
1491
1490
}
1492
1491
nbytes = n * itemsize ;
1493
1492
1494
- b = _PyObject_CallMethodId (f , & PyId_read , "n" , nbytes );
1493
+ b = _PyObject_CallMethod (f , & _Py_ID ( read ) , "n" , nbytes );
1495
1494
if (b == NULL )
1496
1495
return NULL ;
1497
1496
@@ -1546,14 +1545,13 @@ array_array_tofile(arrayobject *self, PyObject *f)
1546
1545
char * ptr = self -> ob_item + i * BLOCKSIZE ;
1547
1546
Py_ssize_t size = BLOCKSIZE ;
1548
1547
PyObject * bytes , * res ;
1549
- _Py_IDENTIFIER (write );
1550
1548
1551
1549
if (i * BLOCKSIZE + size > nbytes )
1552
1550
size = nbytes - i * BLOCKSIZE ;
1553
1551
bytes = PyBytes_FromStringAndSize (ptr , size );
1554
1552
if (bytes == NULL )
1555
1553
return NULL ;
1556
- res = _PyObject_CallMethodIdOneArg (f , & PyId_write , bytes );
1554
+ res = PyObject_CallMethodOneArg (f , & _Py_ID ( write ) , bytes );
1557
1555
Py_DECREF (bytes );
1558
1556
if (res == NULL )
1559
1557
return NULL ;
@@ -2193,16 +2191,14 @@ array_array___reduce_ex__(arrayobject *self, PyObject *value)
2193
2191
int mformat_code ;
2194
2192
static PyObject * array_reconstructor = NULL ;
2195
2193
long protocol ;
2196
- _Py_IDENTIFIER (_array_reconstructor );
2197
- _Py_IDENTIFIER (__dict__ );
2198
2194
2199
2195
if (array_reconstructor == NULL ) {
2200
2196
PyObject * array_module = PyImport_ImportModule ("array" );
2201
2197
if (array_module == NULL )
2202
2198
return NULL ;
2203
- array_reconstructor = _PyObject_GetAttrId (
2199
+ array_reconstructor = PyObject_GetAttr (
2204
2200
array_module ,
2205
- & PyId__array_reconstructor );
2201
+ & _Py_ID ( _array_reconstructor ) );
2206
2202
Py_DECREF (array_module );
2207
2203
if (array_reconstructor == NULL )
2208
2204
return NULL ;
@@ -2217,7 +2213,7 @@ array_array___reduce_ex__(arrayobject *self, PyObject *value)
2217
2213
if (protocol == -1 && PyErr_Occurred ())
2218
2214
return NULL ;
2219
2215
2220
- if (_PyObject_LookupAttrId ((PyObject * )self , & PyId___dict__ , & dict ) < 0 ) {
2216
+ if (_PyObject_LookupAttr ((PyObject * )self , & _Py_ID ( __dict__ ) , & dict ) < 0 ) {
2221
2217
return NULL ;
2222
2218
}
2223
2219
if (dict == NULL ) {
@@ -2946,8 +2942,7 @@ static PyObject *
2946
2942
array_arrayiterator___reduce___impl (arrayiterobject * self )
2947
2943
/*[clinic end generated code: output=7898a52e8e66e016 input=a062ea1e9951417a]*/
2948
2944
{
2949
- _Py_IDENTIFIER (iter );
2950
- PyObject * func = _PyEval_GetBuiltinId (& PyId_iter );
2945
+ PyObject * func = _PyEval_GetBuiltin (& _Py_ID (iter ));
2951
2946
if (self -> ao == NULL ) {
2952
2947
return Py_BuildValue ("N(())" , func );
2953
2948
}
0 commit comments