diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-07-29 09:27:14 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-29 09:27:14 (GMT) |
| commit | c26dd270f7c7301636b23d70afaaeabb2f52eedf (patch) | |
| tree | 2325586beff512513708a31f7d12f2f5eaf1fe4a /Modules/_pickle.c | |
| parent | d113359341374a0d7e956aaf13f1659440851aa6 (diff) | |
| download | cpython-c26dd270f7c7301636b23d70afaaeabb2f52eedf.zip cpython-c26dd270f7c7301636b23d70afaaeabb2f52eedf.tar.gz cpython-c26dd270f7c7301636b23d70afaaeabb2f52eedf.tar.bz2 | |
[3.13] gh-122311: Fix some error messages in pickle (GH-122386) (GH-122387)
(cherry picked from commit 3b034d26eb8480f8d12ae11f42d038d24cf8498a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules/_pickle.c')
| -rw-r--r-- | Modules/_pickle.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 21be72c..3a2e8bc 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -1817,10 +1817,10 @@ get_dotted_path(PyObject *obj, PyObject *name) if (_PyUnicode_EqualToASCIIString(subpath, "<locals>")) { if (obj == NULL) PyErr_Format(PyExc_AttributeError, - "Can't pickle local object %R", name); + "Can't get local object %R", name); else PyErr_Format(PyExc_AttributeError, - "Can't pickle local attribute %R on %R", name, obj); + "Can't get local attribute %R on %R", name, obj); Py_DECREF(dotted_path); return NULL; } @@ -2507,7 +2507,7 @@ save_picklebuffer(PickleState *st, PicklerObject *self, PyObject *obj) { if (self->proto < 5) { PyErr_SetString(st->PicklingError, - "PickleBuffer can only pickled with protocol >= 5"); + "PickleBuffer can only be pickled with protocol >= 5"); return -1; } const Py_buffer* view = PyPickleBuffer_GetBuffer(obj); |
