summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2022-10-25 22:56:59 (GMT)
committerGitHub <noreply@github.com>2022-10-25 22:56:59 (GMT)
commit7cfbb49fcd4c85f9bab3797302eadf93df490344 (patch)
treea20c316c8296dbe3e327e7fcf19925e8090ee267 /Include/cpython
parent1f737edb67e702095feb97118a911afb569f5705 (diff)
downloadcpython-7cfbb49fcd4c85f9bab3797302eadf93df490344.zip
cpython-7cfbb49fcd4c85f9bab3797302eadf93df490344.tar.gz
cpython-7cfbb49fcd4c85f9bab3797302eadf93df490344.tar.bz2
gh-91058: Add error suggestions to 'import from' import errors (#98305)
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/pyerrors.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h
index f33d3ca..1413416 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))