summaryrefslogtreecommitdiff
path: root/Modules/clinic/resource.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/clinic/resource.c.h')
-rw-r--r--Modules/clinic/resource.c.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/Modules/clinic/resource.c.h b/Modules/clinic/resource.c.h
index cd9fae1df0..0a66f8fd66 100644
--- a/Modules/clinic/resource.c.h
+++ b/Modules/clinic/resource.c.h
@@ -19,7 +19,13 @@ resource_getrusage(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int who;
- if (!PyArg_Parse(arg, "i:getrusage", &who)) {
+ 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;
}
return_value = resource_getrusage_impl(module, who);
@@ -45,7 +51,13 @@ resource_getrlimit(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int resource;
- if (!PyArg_Parse(arg, "i:getrlimit", &resource)) {
+ 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;
}
return_value = resource_getrlimit_impl(module, resource);
@@ -157,4 +169,4 @@ exit:
#ifndef RESOURCE_PRLIMIT_METHODDEF
#define RESOURCE_PRLIMIT_METHODDEF
#endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */
-/*[clinic end generated code: output=637ed2c42bde5ca6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b16a9149639081fd input=a9049054013a1b77]*/