aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Modules/posixmodule.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2024-12-23 19:39:02 +0300
committershadchin <shadchin@yandex-team.com>2024-12-23 19:54:20 +0300
commit65a5bf9d37a3b29eb394f560b9a09318196c40e8 (patch)
treee5cd68fb0682b2388e52d9806bb87adc348e21a8 /contrib/tools/python3/Modules/posixmodule.c
parenta1dd87a52878ab3e46e5fd2dba5ecbba6113d7e0 (diff)
downloadydb-65a5bf9d37a3b29eb394f560b9a09318196c40e8.tar.gz
Update Python 3 to 3.12.8
commit_hash:c20045b8a987d8720e1f3328270357491d5530f3
Diffstat (limited to 'contrib/tools/python3/Modules/posixmodule.c')
-rw-r--r--contrib/tools/python3/Modules/posixmodule.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/contrib/tools/python3/Modules/posixmodule.c b/contrib/tools/python3/Modules/posixmodule.c
index e5680a9874..ce2c80e6da 100644
--- a/contrib/tools/python3/Modules/posixmodule.c
+++ b/contrib/tools/python3/Modules/posixmodule.c
@@ -24,6 +24,7 @@
#include "pycore_object.h" // _PyObject_LookupSpecial()
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_signal.h" // Py_NSIG
+#include "pycore_typeobject.h" // _PyType_AddMethod()
#ifdef MS_WINDOWS
# include <windows.h>
@@ -5210,7 +5211,6 @@ _testFileType(path_t *path, int testedType)
os._path_exists -> bool
path: path_t(allow_fd=True, suppress_value_error=True)
- /
Test whether a path exists. Returns False for broken symbolic links.
@@ -5218,7 +5218,7 @@ Test whether a path exists. Returns False for broken symbolic links.
static int
os__path_exists_impl(PyObject *module, path_t *path)
-/*[clinic end generated code: output=8da13acf666e16ba input=29198507a6082a57]*/
+/*[clinic end generated code: output=8da13acf666e16ba input=142beabfc66783eb]*/
{
return _testFileExists(path, TRUE);
}
@@ -7868,6 +7868,16 @@ os_sched_param_impl(PyTypeObject *type, PyObject *sched_priority)
return res;
}
+static PyObject *
+os_sched_param_reduce(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return Py_BuildValue("(O(N))", Py_TYPE(self), PyStructSequence_GetItem(self, 0));
+}
+
+static PyMethodDef os_sched_param_reduce_method = {
+ "__reduce__", (PyCFunction)os_sched_param_reduce, METH_NOARGS|METH_COEXIST, NULL,
+};
+
PyDoc_VAR(os_sched_param__doc__);
static PyStructSequence_Field sched_param_fields[] = {
@@ -17006,6 +17016,12 @@ posixmodule_exec(PyObject *m)
return -1;
}
((PyTypeObject *)state->SchedParamType)->tp_new = os_sched_param;
+ if (_PyType_AddMethod((PyTypeObject *)state->SchedParamType,
+ &os_sched_param_reduce_method) < 0)
+ {
+ return -1;
+ }
+ PyType_Modified((PyTypeObject *)state->SchedParamType);
#endif
/* initialize TerminalSize_info */