@@ -24,8 +24,16 @@ module resource
24
24
class pid_t_converter(CConverter):
25
25
type = 'pid_t'
26
26
format_unit = '" _Py_PARSE_PID "'
27
+
28
+ def parse_arg(self, argname, displayname):
29
+ return """
30
+ {paramname} = PyLong_AsPid({argname});
31
+ if ({paramname} == -1 && PyErr_Occurred()) {{{{
32
+ goto exit;
33
+ }}}}
34
+ """.format(argname=argname, paramname=self.parser_name)
27
35
[python start generated code]*/
28
- /*[python end generated code: output=da39a3ee5e6b4b0d input=0c1d19f640d57e48 ]*/
36
+ /*[python end generated code: output=da39a3ee5e6b4b0d input=5af1c116d56cbb5a ]*/
29
37
30
38
#include "clinic/resource.c.h"
31
39
@@ -268,17 +276,15 @@ resource.prlimit
268
276
269
277
pid: pid_t
270
278
resource: int
271
- [
272
- limits: object
273
- ]
279
+ limits: object = None
274
280
/
275
281
276
282
[clinic start generated code]*/
277
283
278
284
static PyObject *
279
285
resource_prlimit_impl (PyObject * module , pid_t pid , int resource ,
280
- int group_right_1 , PyObject * limits )
281
- /*[clinic end generated code: output=ee976b393187a7a3 input=b77743bdccc83564 ]*/
286
+ PyObject * limits )
287
+ /*[clinic end generated code: output=6ebc49ff8c3a816e input=54bb69c9585e33bf ]*/
282
288
{
283
289
struct rlimit old_limit , new_limit ;
284
290
int retval ;
@@ -294,7 +300,7 @@ resource_prlimit_impl(PyObject *module, pid_t pid, int resource,
294
300
return NULL ;
295
301
}
296
302
297
- if (group_right_1 ) {
303
+ if (limits != Py_None ) {
298
304
if (py2rlimit (limits , & new_limit ) < 0 ) {
299
305
return NULL ;
300
306
}
0 commit comments