From 7cfbb49fcd4c85f9bab3797302eadf93df490344 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Tue, 25 Oct 2022 23:56:59 +0100 Subject: gh-91058: Add error suggestions to 'import from' import errors (#98305) --- Include/cpython/pyerrors.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Include/cpython/pyerrors.h') diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h index f33d3caaa2..1413416677 100644 --- a/Include/cpython/pyerrors.h +++ b/Include/cpython/pyerrors.h @@ -37,6 +37,7 @@ typedef struct { PyObject *msg; PyObject *name; PyObject *path; + PyObject *name_from; } PyImportErrorObject; typedef struct { @@ -176,4 +177,11 @@ PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalErrorFormat( const char *format, ...); +extern PyObject *_PyErr_SetImportErrorWithNameFrom( + PyObject *, + PyObject *, + PyObject *, + PyObject *); + + #define Py_FatalError(message) _Py_FatalErrorFunc(__func__, (message)) -- cgit v1.2.1