Fix incorrect replacements in Py_ to Ty_ renaming

Fixed several macros and constants that should not have been renamed:
- _Py_CAST, _Py_NULL, _Py_RVALUE (internal utility macros)
- Py_UNUSED (unused parameter macro)
- Py_EQ, Py_NE, Py_LT, Py_LE, Py_GT, Py_GE (comparison constants)
- Py_RETURN_* macros (NONE, TRUE, FALSE, NOTIMPLEMENTED, RICHCOMPARE)
- Py_READONLY, Py_ULL, Py_CONTEXT_SWITCHED
- TyGC_Head in generated clinic files

Build is still in progress with some remaining issues to resolve.

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-29 17:44:05 +00:00
parent b198f511d2
commit 42e2356c88
367 changed files with 3520 additions and 3520 deletions

View File

@@ -3356,7 +3356,7 @@ get_path_importer(PyThreadState *tstate, TyObject *path_importer_cache,
_TyErr_Clear(tstate);
}
if (importer == NULL) {
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
if (TyDict_SetItem(path_importer_cache, p, importer) < 0) {
Ty_DECREF(importer);
@@ -3559,7 +3559,7 @@ resolve_name(PyThreadState *tstate, TyObject *name, TyObject *globals, int level
goto error;
}
equal = PyObject_RichCompareBool(package, parent, Ty_EQ);
equal = PyObject_RichCompareBool(package, parent, Py_EQ);
Ty_DECREF(parent);
if (equal < 0) {
goto error;
@@ -4271,7 +4271,7 @@ _imp_acquire_lock_impl(TyObject *module)
{
PyInterpreterState *interp = _TyInterpreterState_GET();
_TyImport_AcquireLock(interp);
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
/*[clinic input]
@@ -4293,7 +4293,7 @@ _imp_release_lock_impl(TyObject *module)
return NULL;
}
_TyImport_ReleaseLock(interp);
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
@@ -4318,7 +4318,7 @@ _imp__fix_co_filename_impl(TyObject *module, PyCodeObject *code,
{
update_compiled_module(code, path);
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
@@ -4413,7 +4413,7 @@ _imp_init_frozen_impl(TyObject *module, TyObject *name)
if (ret < 0)
return NULL;
if (ret == 0) {
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
return import_add_module(tstate, name);
}
@@ -4444,10 +4444,10 @@ _imp_find_frozen_impl(TyObject *module, TyObject *name, int withdata)
struct frozen_info info;
frozen_status status = find_frozen(name, &info);
if (status == FROZEN_NOT_FOUND || status == FROZEN_DISABLED) {
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
else if (status == FROZEN_BAD_NAME) {
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
else if (status != FROZEN_OKAY) {
set_frozen_error(status, name);
@@ -4586,9 +4586,9 @@ _imp_is_frozen_impl(TyObject *module, TyObject *name)
struct frozen_info info;
frozen_status status = find_frozen(name, &info);
if (status != FROZEN_OKAY) {
Ty_RETURN_FALSE;
Py_RETURN_FALSE;
}
Ty_RETURN_TRUE;
Py_RETURN_TRUE;
}
/*[clinic input]
@@ -4622,7 +4622,7 @@ _imp__override_frozen_modules_for_tests_impl(TyObject *module, int override)
{
PyInterpreterState *interp = _TyInterpreterState_GET();
OVERRIDE_FROZEN_MODULES(interp) = override;
Ty_RETURN_NONE;
Py_RETURN_NONE;
}
/*[clinic input]