mirror of
https://github.com/python/cpython
synced 2026-09-29 09:25:29 +03:00
Fix merge breakage.
This commit is contained in:
parent
9f2e346911
commit
5d7428b8ce
9 changed files with 26 additions and 26 deletions
|
|
@ -102,7 +102,7 @@ PyBytes_FromStringAndSize(const char *bytes, Py_ssize_t size)
|
|||
memcpy(new->ob_bytes, bytes, size);
|
||||
new->ob_bytes[size] = '\0'; /* Trailing null byte */
|
||||
}
|
||||
new->ob_size = size;
|
||||
Py_Size(new) = size;
|
||||
new->ob_alloc = alloc;
|
||||
|
||||
return (PyObject *)new;
|
||||
|
|
@ -232,7 +232,7 @@ bytes_iconcat(PyBytesObject *self, PyObject *other)
|
|||
return PyErr_NoMemory();
|
||||
if (size < self->ob_alloc) {
|
||||
Py_Size(self) = size;
|
||||
self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
|
||||
self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
|
||||
}
|
||||
else if (PyBytes_Resize((PyObject *)self, size) < 0)
|
||||
return NULL;
|
||||
|
|
@ -281,7 +281,7 @@ bytes_irepeat(PyBytesObject *self, Py_ssize_t count)
|
|||
return PyErr_NoMemory();
|
||||
if (size < self->ob_alloc) {
|
||||
Py_Size(self) = size;
|
||||
self->ob_bytes[self->ob_size] = '\0'; /* Trailing null byte */
|
||||
self->ob_bytes[Py_Size(self)] = '\0'; /* Trailing null byte */
|
||||
}
|
||||
else if (PyBytes_Resize((PyObject *)self, size) < 0)
|
||||
return NULL;
|
||||
|
|
@ -816,7 +816,7 @@ static PyObject *
|
|||
bytes_repr(PyBytesObject *self)
|
||||
{
|
||||
static const char *hexdigits = "0123456789abcdef";
|
||||
size_t newsize = 3 + 4 * self->ob_size;
|
||||
size_t newsize = 3 + 4 * Py_Size(self);
|
||||
PyObject *v;
|
||||
if (newsize > PY_SSIZE_T_MAX || newsize / 4 != Py_Size(self)) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
|
|
@ -2594,7 +2594,7 @@ static PyObject *
|
|||
bytes_join(PyBytesObject *self, PyObject *it)
|
||||
{
|
||||
PyObject *seq;
|
||||
Py_ssize_t mysize = self->ob_size;
|
||||
Py_ssize_t mysize = Py_Size(self);
|
||||
Py_ssize_t i;
|
||||
Py_ssize_t n;
|
||||
PyObject **items;
|
||||
|
|
@ -2727,7 +2727,7 @@ bytes_reduce(PyBytesObject *self)
|
|||
return Py_BuildValue("(O(s#s))",
|
||||
Py_Type(self),
|
||||
self->ob_bytes == NULL ? "" : self->ob_bytes,
|
||||
self->ob_size,
|
||||
Py_Size(self),
|
||||
"latin-1");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -619,21 +619,21 @@ set_repr(PySetObject *so)
|
|||
if (status != 0) {
|
||||
if (status < 0)
|
||||
return NULL;
|
||||
return PyUnicode_FromFormat("%s(...)", so->ob_type->tp_name);
|
||||
return PyUnicode_FromFormat("%s(...)", Py_Type(so)->tp_name);
|
||||
}
|
||||
|
||||
/* shortcut for the empty set */
|
||||
if (!so->used) {
|
||||
Py_ReprLeave((PyObject*)so);
|
||||
return PyUnicode_FromFormat("%s()", so->ob_type->tp_name);
|
||||
return PyUnicode_FromFormat("%s()", Py_Type(so)->tp_name);
|
||||
}
|
||||
|
||||
keys = PySequence_List((PyObject *)so);
|
||||
if (keys == NULL)
|
||||
goto done;
|
||||
|
||||
if (so->ob_type != &PySet_Type) {
|
||||
result = PyUnicode_FromFormat("%s(%R)", so->ob_type->tp_name, keys);
|
||||
if (Py_Type(so) != &PySet_Type) {
|
||||
result = PyUnicode_FromFormat("%s(%R)", Py_Type(so)->tp_name, keys);
|
||||
Py_DECREF(keys);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -835,7 +835,7 @@ PyString_Repr(PyObject *obj, int smartquotes)
|
|||
static const char *hexdigits = "0123456789abcdef";
|
||||
register PyStringObject* op = (PyStringObject*) obj;
|
||||
Py_ssize_t length = PyString_GET_SIZE(op);
|
||||
size_t newsize = 3 + 4 * op->ob_size;
|
||||
size_t newsize = 3 + 4 * Py_Size(op);
|
||||
PyObject *v;
|
||||
if (newsize > PY_SSIZE_T_MAX || newsize / 4 != Py_Size(op)) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ void unicode_dealloc(register PyUnicodeObject *unicode)
|
|||
|
||||
case SSTATE_INTERNED_MORTAL:
|
||||
/* revive dead object temporarily for DelItem */
|
||||
unicode->ob_refcnt = 3;
|
||||
Py_Refcnt(unicode) = 3;
|
||||
if (PyDict_DelItem(interned, (PyObject *)unicode) != 0)
|
||||
Py_FatalError(
|
||||
"deletion of interned unicode string failed");
|
||||
|
|
@ -8758,7 +8758,7 @@ PyUnicode_InternInPlace(PyObject **p)
|
|||
PyThreadState_GET()->recursion_critical = 0;
|
||||
/* The two references in interned are not counted by refcnt.
|
||||
The deallocator will take care of this */
|
||||
s->ob_refcnt -= 2;
|
||||
Py_Refcnt(s) -= 2;
|
||||
PyUnicode_CHECK_INTERNED(s) = SSTATE_INTERNED_MORTAL;
|
||||
}
|
||||
|
||||
|
|
@ -8812,11 +8812,11 @@ void _Py_ReleaseInternedUnicodeStrings(void)
|
|||
/* XXX Shouldn't happen */
|
||||
break;
|
||||
case SSTATE_INTERNED_IMMORTAL:
|
||||
s->ob_refcnt += 1;
|
||||
Py_Refcnt(s) += 1;
|
||||
immortal_size += s->length;
|
||||
break;
|
||||
case SSTATE_INTERNED_MORTAL:
|
||||
s->ob_refcnt += 2;
|
||||
Py_Refcnt(s) += 2;
|
||||
mortal_size += s->length;
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue