diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-09-29 05:48:46 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-09-29 05:48:46 (GMT) |
commit | 4b430e5f6954ef4b248e95bfb4087635dcdefc6d (patch) | |
tree | cf08662ef8f8883f3d4c0eed2e70b0c57a56e7c6 | |
parent | e2f48bf0e851dc79d888c70fd24c631a8a9e1030 (diff) | |
download | cpython-4b430e5f6954ef4b248e95bfb4087635dcdefc6d.zip cpython-4b430e5f6954ef4b248e95bfb4087635dcdefc6d.tar.gz cpython-4b430e5f6954ef4b248e95bfb4087635dcdefc6d.tar.bz2 |
Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)
_pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.
-rw-r--r-- | Modules/_pickle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 3588e33..0e3bd22 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6792,7 +6792,7 @@ _pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, self->stack = (Pdata *)Pdata_New(); if (self->stack == NULL) - return 1; + return -1; self->memo_size = 32; self->memo = _Unpickler_NewMemo(self->memo_size); |