diff options
-rw-r--r-- | Modules/_pickle.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 0fbd440..4389f72 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -5318,13 +5318,12 @@ load(UnpicklerObject *self) case STOP: break; - case '\0': - PyErr_SetNone(PyExc_EOFError); - return NULL; - default: - PyErr_Format(UnpicklingError, - "invalid load key, '%c'.", s[0]); + if (s[0] == '\0') + PyErr_SetNone(PyExc_EOFError); + else + PyErr_Format(UnpicklingError, + "invalid load key, '%c'.", s[0]); return NULL; } |