From 87d3b9db4ade1aa100ee6f065082cb7e85b8992f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 25 Mar 2020 19:27:36 +0100 Subject: bpo-39882: Add _Py_FatalErrorFormat() function (GH-19157) --- Python/import.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Python/import.c') diff --git a/Python/import.c b/Python/import.c index 936ad1fd50..645ebdf7b3 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, -- cgit v1.2.1