mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Fix some trivial things in cPickle due to the renaming of the string types.
This commit is contained in:
parent
6cb726a9f2
commit
32c38e7420
1 changed files with 2 additions and 7 deletions
|
|
@ -2217,13 +2217,11 @@ save(Picklerobject *self, PyObject *args, int pers_save)
|
|||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
case 's': /* str8, str */
|
||||
if ((type == &PyString_Type) && (PyString_GET_SIZE(args) < 2)) {
|
||||
res = save_string(self, args, 0);
|
||||
goto finally;
|
||||
}
|
||||
|
||||
case 'u':
|
||||
if ((type == &PyUnicode_Type) && (PyString_GET_SIZE(args) < 2)) {
|
||||
res = save_unicode(self, args, 0);
|
||||
goto finally;
|
||||
|
|
@ -2244,14 +2242,11 @@ save(Picklerobject *self, PyObject *args, int pers_save)
|
|||
}
|
||||
|
||||
switch (type->tp_name[0]) {
|
||||
case 's':
|
||||
case 's': /* str8, str */
|
||||
if (type == &PyString_Type) {
|
||||
res = save_string(self, args, 1);
|
||||
goto finally;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
if (type == &PyUnicode_Type) {
|
||||
res = save_unicode(self, args, 1);
|
||||
goto finally;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue