mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)
This commit is contained in:
parent
ace018ca47
commit
87d3b9db4a
15 changed files with 158 additions and 110 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue