@@ -3643,33 +3643,30 @@ make_impl_info(PyObject *version_info)
36433643static PyObject *
36443644make_abi_info (void )
36453645{
3646- // New entries should be added when needed for a supported platform, or (for
3647- // enabling an unsupported one) by core dev consensus. Entries should be removed
3648- // following PEP 387.
3649- int res ;
3650- PyObject * abi_info , * value , * ns ;
3651- abi_info = PyDict_New ();
3646+ // New entries should be added when needed for a supported platform,
3647+ // or by core dev consensus for enabling an unsupported one.
3648+
3649+ PyObject * abi_info = PyDict_New ();
36523650 if (abi_info == NULL ) {
3653- goto error ;
3651+ return NULL ;
36543652 }
36553653
3654+ PyObject * value ;
36563655 value = PyLong_FromLong (sizeof (void * ) * 8 );
36573656 if (value == NULL ) {
36583657 goto error ;
36593658 }
3660- res = PyDict_SetItemString (abi_info , "pointer_bits" , value );
3661- Py_DECREF (value );
3662- if (res < 0 ) {
3659+ if (PyDict_SetItemString (abi_info , "pointer_bits" , value ) < 0 ) {
36633660 goto error ;
36643661 }
3662+ Py_DECREF (value );
36653663
36663664#ifdef Py_GIL_DISABLED
36673665 value = Py_True ;
36683666#else
36693667 value = Py_False ;
36703668#endif
3671- res = PyDict_SetItemString (abi_info , "free_threaded" , value );
3672- if (res < 0 ) {
3669+ if (PyDict_SetItemString (abi_info , "free_threaded" , value ) < 0 ) {
36733670 goto error ;
36743671 }
36753672
@@ -3678,31 +3675,26 @@ make_abi_info(void)
36783675#else
36793676 value = Py_False ;
36803677#endif
3681- res = PyDict_SetItemString (abi_info , "debug" , value );
3682- if (res < 0 ) {
3678+ if (PyDict_SetItemString (abi_info , "debug" , value ) < 0 ) {
36833679 goto error ;
36843680 }
36853681
36863682#if PY_BIG_ENDIAN
3687- value = PyUnicode_FromString ( " big" );
3683+ value = & _Py_ID ( big );
36883684#else
3689- value = PyUnicode_FromString ( " little" );
3685+ value = & _Py_ID ( little );
36903686#endif
3691- if (value == NULL ) {
3692- goto error ;
3693- }
3694- res = PyDict_SetItemString (abi_info , "byteorder" , value );
3695- Py_DECREF (value );
3696- if (res < 0 ) {
3687+ if (PyDict_SetItemString (abi_info , "byteorder" , value ) < 0 ) {
36973688 goto error ;
36983689 }
36993690
3700- ns = _PyNamespace_New (abi_info );
3691+ PyObject * ns = _PyNamespace_New (abi_info );
37013692 Py_DECREF (abi_info );
37023693 return ns ;
37033694
37043695error :
37053696 Py_DECREF (abi_info );
3697+ Py_XDECREF (value );
37063698 return NULL ;
37073699}
37083700
0 commit comments