aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Modules/clinic/resource.c.h
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Modules/clinic/resource.c.h
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/clinic/resource.c.h')
-rw-r--r--contrib/tools/python3/src/Modules/clinic/resource.c.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/contrib/tools/python3/src/Modules/clinic/resource.c.h b/contrib/tools/python3/src/Modules/clinic/resource.c.h
index 410b82d1a4..80efb714bb 100644
--- a/contrib/tools/python3/src/Modules/clinic/resource.c.h
+++ b/contrib/tools/python3/src/Modules/clinic/resource.c.h
@@ -19,15 +19,15 @@ resource_getrusage(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int who;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
+ if (PyFloat_Check(arg)) {
+ PyErr_SetString(PyExc_TypeError,
+ "integer argument expected, got float" );
+ goto exit;
+ }
+ who = _PyLong_AsInt(arg);
+ if (who == -1 && PyErr_Occurred()) {
goto exit;
}
- who = _PyLong_AsInt(arg);
- if (who == -1 && PyErr_Occurred()) {
- goto exit;
- }
return_value = resource_getrusage_impl(module, who);
exit:
@@ -51,15 +51,15 @@ resource_getrlimit(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int resource;
- if (PyFloat_Check(arg)) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
+ if (PyFloat_Check(arg)) {
+ PyErr_SetString(PyExc_TypeError,
+ "integer argument expected, got float" );
+ goto exit;
+ }
+ resource = _PyLong_AsInt(arg);
+ if (resource == -1 && PyErr_Occurred()) {
goto exit;
}
- resource = _PyLong_AsInt(arg);
- if (resource == -1 && PyErr_Occurred()) {
- goto exit;
- }
return_value = resource_getrlimit_impl(module, resource);
exit:
@@ -72,7 +72,7 @@ PyDoc_STRVAR(resource_setrlimit__doc__,
"\n");
#define RESOURCE_SETRLIMIT_METHODDEF \
- {"setrlimit", (PyCFunction)(void(*)(void))resource_setrlimit, METH_FASTCALL, resource_setrlimit__doc__},
+ {"setrlimit", (PyCFunction)(void(*)(void))resource_setrlimit, METH_FASTCALL, resource_setrlimit__doc__},
static PyObject *
resource_setrlimit_impl(PyObject *module, int resource, PyObject *limits);
@@ -84,19 +84,19 @@ resource_setrlimit(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
int resource;
PyObject *limits;
- if (!_PyArg_CheckPositional("setrlimit", nargs, 2, 2)) {
+ if (!_PyArg_CheckPositional("setrlimit", nargs, 2, 2)) {
+ goto exit;
+ }
+ if (PyFloat_Check(args[0])) {
+ PyErr_SetString(PyExc_TypeError,
+ "integer argument expected, got float" );
+ goto exit;
+ }
+ resource = _PyLong_AsInt(args[0]);
+ if (resource == -1 && PyErr_Occurred()) {
goto exit;
}
- if (PyFloat_Check(args[0])) {
- PyErr_SetString(PyExc_TypeError,
- "integer argument expected, got float" );
- goto exit;
- }
- resource = _PyLong_AsInt(args[0]);
- if (resource == -1 && PyErr_Occurred()) {
- goto exit;
- }
- limits = args[1];
+ limits = args[1];
return_value = resource_setrlimit_impl(module, resource, limits);
exit:
@@ -178,4 +178,4 @@ exit:
#ifndef RESOURCE_PRLIMIT_METHODDEF
#define RESOURCE_PRLIMIT_METHODDEF
#endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */
-/*[clinic end generated code: output=ef3034f291156a34 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ef3034f291156a34 input=a9049054013a1b77]*/