mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
2
Python/generated_cases.c.h
generated
2
Python/generated_cases.c.h
generated
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user