summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Objects
diff options
context:
space:
mode:
authorshadchin <[email protected]>2023-12-13 02:43:57 +0300
committershadchin <[email protected]>2023-12-13 03:08:48 +0300
commit5b48aabc614c6d407f885f3b228dc484ad4c5ba9 (patch)
tree602eb5cc5d85bf730c1de1fa50a13c2ee552830d /contrib/tools/python3/src/Objects
parent35d7049b38602e8cbfcd3f96257329a1abce947e (diff)
Update Python 3 to 3.11.7
Diffstat (limited to 'contrib/tools/python3/src/Objects')
-rw-r--r--contrib/tools/python3/src/Objects/bytearrayobject.c5
-rw-r--r--contrib/tools/python3/src/Objects/frameobject.c12
-rw-r--r--contrib/tools/python3/src/Objects/typeobject.c8
3 files changed, 18 insertions, 7 deletions
diff --git a/contrib/tools/python3/src/Objects/bytearrayobject.c b/contrib/tools/python3/src/Objects/bytearrayobject.c
index 6d46ebe2a44..1c502030842 100644
--- a/contrib/tools/python3/src/Objects/bytearrayobject.c
+++ b/contrib/tools/python3/src/Objects/bytearrayobject.c
@@ -2008,7 +2008,10 @@ static PyObject *
bytearray_join(PyByteArrayObject *self, PyObject *iterable_of_bytes)
/*[clinic end generated code: output=a8516370bf68ae08 input=aba6b1f9b30fcb8e]*/
{
- return stringlib_bytes_join((PyObject*)self, iterable_of_bytes);
+ self->ob_exports++; // this protects `self` from being cleared/resized if `iterable_of_bytes` is a custom iterator
+ PyObject* ret = stringlib_bytes_join((PyObject*)self, iterable_of_bytes);
+ self->ob_exports--; // unexport `self`
+ return ret;
}
/*[clinic input]
diff --git a/contrib/tools/python3/src/Objects/frameobject.c b/contrib/tools/python3/src/Objects/frameobject.c
index 425749d14cf..c95e8711880 100644
--- a/contrib/tools/python3/src/Objects/frameobject.c
+++ b/contrib/tools/python3/src/Objects/frameobject.c
@@ -315,19 +315,27 @@ mark_stacks(PyCodeObject *code_obj, int len)
case POP_JUMP_BACKWARD_IF_FALSE:
case POP_JUMP_FORWARD_IF_TRUE:
case POP_JUMP_BACKWARD_IF_TRUE:
+ case POP_JUMP_FORWARD_IF_NONE:
+ case POP_JUMP_BACKWARD_IF_NONE:
+ case POP_JUMP_FORWARD_IF_NOT_NONE:
+ case POP_JUMP_BACKWARD_IF_NOT_NONE:
{
int64_t target_stack;
int j = get_arg(code, i);
if (opcode == POP_JUMP_FORWARD_IF_FALSE ||
opcode == POP_JUMP_FORWARD_IF_TRUE ||
opcode == JUMP_IF_FALSE_OR_POP ||
- opcode == JUMP_IF_TRUE_OR_POP)
+ opcode == JUMP_IF_TRUE_OR_POP ||
+ opcode == POP_JUMP_FORWARD_IF_NONE ||
+ opcode == POP_JUMP_FORWARD_IF_NOT_NONE)
{
j += i + 1;
}
else {
assert(opcode == POP_JUMP_BACKWARD_IF_FALSE ||
- opcode == POP_JUMP_BACKWARD_IF_TRUE);
+ opcode == POP_JUMP_BACKWARD_IF_TRUE ||
+ opcode == POP_JUMP_BACKWARD_IF_NONE ||
+ opcode == POP_JUMP_BACKWARD_IF_NOT_NONE);
j = i + 1 - j;
}
assert(j < len);
diff --git a/contrib/tools/python3/src/Objects/typeobject.c b/contrib/tools/python3/src/Objects/typeobject.c
index 4bdf1881581..8c2e725cac9 100644
--- a/contrib/tools/python3/src/Objects/typeobject.c
+++ b/contrib/tools/python3/src/Objects/typeobject.c
@@ -2399,21 +2399,21 @@ subtype_getweakref(PyObject *obj, void *context)
static PyGetSetDef subtype_getsets_full[] = {
{"__dict__", subtype_dict, subtype_setdict,
- PyDoc_STR("dictionary for instance variables (if defined)")},
+ PyDoc_STR("dictionary for instance variables")},
{"__weakref__", subtype_getweakref, NULL,
- PyDoc_STR("list of weak references to the object (if defined)")},
+ PyDoc_STR("list of weak references to the object")},
{0}
};
static PyGetSetDef subtype_getsets_dict_only[] = {
{"__dict__", subtype_dict, subtype_setdict,
- PyDoc_STR("dictionary for instance variables (if defined)")},
+ PyDoc_STR("dictionary for instance variables")},
{0}
};
static PyGetSetDef subtype_getsets_weakref_only[] = {
{"__weakref__", subtype_getweakref, NULL,
- PyDoc_STR("list of weak references to the object (if defined)")},
+ PyDoc_STR("list of weak references to the object")},
{0}
};