Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 153cc0f commit 29ac3cbCopy full SHA for 29ac3cb
1 file changed
Modules/resource.c
@@ -160,7 +160,7 @@ resource_methods[] = {
160
DL_EXPORT(void)
161
initresource(void)
162
{
163
- PyObject *m;
+ PyObject *m, *v;
164
165
/* Create the module and add the functions */
166
m = Py_InitModule("resource", resource_methods);
@@ -233,4 +233,16 @@ initresource(void)
233
#ifdef RUSAGE_BOTH
234
PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH);
235
#endif
236
+
237
+#if defined(HAVE_LONG_LONG)
238
+ if (sizeof(RLIM_INFINITY) > sizeof(long)) {
239
+ v = PyLong_FromLongLong((LONG_LONG) RLIM_INFINITY);
240
+ } else
241
+#endif
242
+ {
243
+ v = PyInt_FromLong((long) RLIM_INFINITY);
244
+ }
245
+ if (v) {
246
+ PyModule_AddObject(m, "RLIM_INFINITY", v);
247
248
}
0 commit comments