GH-145247: Use _PyTuple_FromPair in Parser and Python (#145842)

Use _PyTuple_FromPair in Parser and Python
This commit is contained in:
Sergey Miryanov 2026-03-12 02:08:18 +05:00 committed by GitHub
parent f062014d38
commit d19de375a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 16 additions and 11 deletions

View file

@ -1,6 +1,7 @@
#include "Python.h"
#include "errcode.h"
#include "internal/pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION
#include "internal/pycore_tuple.h" // _PyTuple_FromPair
#include "../Parser/lexer/state.h"
#include "../Parser/lexer/lexer.h"
#include "../Parser/tokenizer/tokenizer.h"
@ -164,7 +165,7 @@ _tokenizer_error(tokenizeriterobject *it)
goto exit;
}
value = PyTuple_Pack(2, errstr, tmp);
value = _PyTuple_FromPair(errstr, tmp);
if (!value) {
result = -1;
goto exit;