summaryrefslogtreecommitdiff
path: root/Modules/zipimport.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:40 -0800
committerSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:40 -0800
commitb2fa705fd3887c326e811c418469c784353027f4 (patch)
treeb3428f73de91453edbfd4df1a5d4a212d182eb44 /Modules/zipimport.c
parent134e58fd3aaa2e91390041e143f3f0a21a60142b (diff)
parentb53654b6dbfce8318a7d4d1cdaddca7a7fec194b (diff)
downloadcpython-b2fa705fd3887c326e811c418469c784353027f4.tar.gz
Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r--Modules/zipimport.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 7473a8fe87..59046aaae4 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -907,10 +907,8 @@ read_directory(PyObject *archive)
fp = _Py_fopen_obj(archive, "rb");
if (fp == NULL) {
if (PyErr_ExceptionMatches(PyExc_OSError)) {
- PyObject *exc, *val, *tb;
- PyErr_Fetch(&exc, &val, &tb);
- PyErr_Format(ZipImportError, "can't open Zip file: %R", archive);
- _PyErr_ChainExceptions(exc, val, tb);
+ _PyErr_FormatFromCause(ZipImportError,
+ "can't open Zip file: %R", archive);
}
return NULL;
}