Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)

https://github.com/python/cpython/commit/758ad54dac6360657173d1c56f60510e5cd... commit: 758ad54dac6360657173d1c56f60510e5cdd08b6 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: GitHub <noreply@github.com> date: 2018-09-28T23:01:48-07:00 summary: Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630) _pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1. (cherry picked from commit 4b430e5f6954ef4b248e95bfb4087635dcdefc6d) Co-authored-by: Zackery Spytz <zspytz@gmail.com> files: M Modules/_pickle.c diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 34ce38c5d3b2..ba8962d686de 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6804,7 +6804,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);
participants (1)
-
Miss Islington (bot)