bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)

This commit is contained in:
Victor Stinner 2020-03-25 19:27:36 +01:00 committed by GitHub
parent ace018ca47
commit 87d3b9db4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 158 additions and 110 deletions

View file

@ -209,7 +209,7 @@ _PyImport_ReInitLock(void)
if (import_lock != NULL) {
import_lock = PyThread_allocate_lock();
if (import_lock == NULL) {
Py_FatalError("PyImport_ReInitLock failed to create a new lock");
_Py_FatalErrorFunc(__func__, "failed to create a new lock");
}
}
if (import_lock_level > 1) {
@ -310,7 +310,7 @@ PyImport_GetModuleDict(void)
{
PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE();
if (interp->modules == NULL) {
Py_FatalError("no module dictionary");
Py_FatalError("interpreter has no modules dictionary");
}
return interp->modules;
}
@ -982,7 +982,7 @@ PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co,
_Py_IDENTIFIER(_get_sourcefile);
if (interp == NULL) {
Py_FatalError("no interpreter!");
Py_FatalError("no current interpreter");
}
external= PyObject_GetAttrString(interp->importlib,