summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-25 18:27:36 (GMT)
committerGitHub <noreply@github.com>2020-03-25 18:27:36 (GMT)
commit87d3b9db4ade1aa100ee6f065082cb7e85b8992f (patch)
tree85d17fff35bc28beb4a7c6e3a82276f2fa3760d5 /Python/import.c
parentace018ca47c03ca699603341b12781b5329d2eaa (diff)
downloadcpython-87d3b9db4ade1aa100ee6f065082cb7e85b8992f.zip
cpython-87d3b9db4ade1aa100ee6f065082cb7e85b8992f.tar.gz
cpython-87d3b9db4ade1aa100ee6f065082cb7e85b8992f.tar.bz2
bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157)
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/import.c b/Python/import.c
index 936ad1f..645ebdf 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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,