summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2022-12-23 23:43:19 (GMT)
committerGitHub <noreply@github.com>2022-12-23 23:43:19 (GMT)
commit474220e3a58d739acc5154eb3e000461d2222d62 (patch)
tree2f26951f08993d62a28107b03b1191d6467fd23b /Python
parenta68e585c8b7b27323f67905868467ce0588a1dae (diff)
downloadcpython-474220e3a58d739acc5154eb3e000461d2222d62.zip
cpython-474220e3a58d739acc5154eb3e000461d2222d62.tar.gz
cpython-474220e3a58d739acc5154eb3e000461d2222d62.tar.bz2
gh-99947: Ensure unreported errors are chained for SystemError during import (GH-99946)
Diffstat (limited to 'Python')
-rw-r--r--Python/importdl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 4022767..91fa06f 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);