mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix the code for stripping the leading 's' from str8 and bytes literals.
This commit is contained in:
parent
07d4e78b0f
commit
1718fd1dc5
1 changed files with 3 additions and 1 deletions
|
@ -1086,8 +1086,10 @@ save_string(Picklerobject *self, PyObject *args, int doput)
|
||||||
repr_str = PyString_AS_STRING((PyStringObject *)repr);
|
repr_str = PyString_AS_STRING((PyStringObject *)repr);
|
||||||
|
|
||||||
/* Strip leading 's' due to repr() of str8() returning s'...' */
|
/* Strip leading 's' due to repr() of str8() returning s'...' */
|
||||||
if (repr_str[0] == 's')
|
if (repr_str[0] == 's') {
|
||||||
repr_str++;
|
repr_str++;
|
||||||
|
len--;
|
||||||
|
}
|
||||||
|
|
||||||
if (self->write_func(self, &string, 1) < 0)
|
if (self->write_func(self, &string, 1) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue