Fix exception objects and more Py_ patterns

- Fixed all exception object types: Py*ErrorObject → Ty*ErrorObject
- Fixed Py*ExceptionObject → Ty*ExceptionObject
- Fixed Py*GroupObject, PyStopIterationObject, PySystemExitObject
- Fixed Py_ASNATIVEBYTES_* → Ty_ASNATIVEBYTES_*
- Fixed Py_SAFE_DOWNCAST → Ty_SAFE_DOWNCAST

Build is progressing through more files.

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-29 18:34:50 +00:00
parent 0b5cf5416d
commit 210fb1519d
15 changed files with 181 additions and 181 deletions

View File

@@ -1465,7 +1465,7 @@ dummy_func(
int matches = TyErr_GivenExceptionMatches(exc_value, TyExc_StopIteration);
if (matches) {
value = PyStackRef_FromPyObjectNew(((PyStopIterationObject *)exc_value)->value);
value = PyStackRef_FromPyObjectNew(((TyStopIterationObject *)exc_value)->value);
DECREF_INPUTS();
none = PyStackRef_None;
}

View File

@@ -3328,7 +3328,7 @@ _TyEval_FormatExcCheckArg(TyThreadState *tstate, TyObject *exc,
// Include the name in the NameError exceptions to offer suggestions later.
TyObject *exc = TyErr_GetRaisedException();
if (TyErr_GivenExceptionMatches(exc, TyExc_NameError)) {
if (((PyNameErrorObject*)exc)->name == NULL) {
if (((TyNameErrorObject*)exc)->name == NULL) {
// We do not care if this fails because we are going to restore the
// NameError anyway.
(void)PyObject_SetAttr(exc, &_Ty_ID(name), obj);

View File

@@ -4683,7 +4683,7 @@
int matches = TyErr_GivenExceptionMatches(exc_value, TyExc_StopIteration);
stack_pointer = _TyFrame_GetStackPointer(frame);
if (matches) {
value = PyStackRef_FromPyObjectNew(((PyStopIterationObject *)exc_value)->value);
value = PyStackRef_FromPyObjectNew(((TyStopIterationObject *)exc_value)->value);
_TyFrame_SetStackPointer(frame, stack_pointer);
_PyStackRef tmp = sub_iter;
sub_iter = value;