mirror of
https://github.com/python/cpython.git
synced 2026-04-28 14:50:59 +00:00
gh-91058: Add error suggestions to 'import from' import errors (#98305)
This commit is contained in:
parent
1f737edb67
commit
7cfbb49fcd
11 changed files with 235 additions and 14 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue