diff options
author | Sebastian Berg <sebastianb@nvidia.com> | 2022-12-24 00:43:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 15:43:19 -0800 |
commit | 474220e3a58d739acc5154eb3e000461d2222d62 (patch) | |
tree | 2f26951f08993d62a28107b03b1191d6467fd23b /Python/importdl.c | |
parent | a68e585c8b7b27323f67905868467ce0588a1dae (diff) | |
download | cpython-git-474220e3a58d739acc5154eb3e000461d2222d62.tar.gz |
gh-99947: Ensure unreported errors are chained for SystemError during import (GH-99946)
Diffstat (limited to 'Python/importdl.c')
-rw-r--r-- | Python/importdl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/importdl.c b/Python/importdl.c index 40227674ca..91fa06f49c 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -180,8 +180,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) } goto error; } else if (PyErr_Occurred()) { - PyErr_Clear(); - PyErr_Format( + _PyErr_FormatFromCause( PyExc_SystemError, "initialization of %s raised unreported exception", name_buf); |