mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
bpo-40280: Address more test failures on Emscripten (GH-31050)
Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
9d4161a60c
commit
96b344c2f1
27 changed files with 227 additions and 49 deletions
10
Modules/clinic/resource.c.h
generated
10
Modules/clinic/resource.c.h
generated
|
@ -2,6 +2,8 @@
|
|||
preserve
|
||||
[clinic start generated code]*/
|
||||
|
||||
#if defined(HAVE_GETRUSAGE)
|
||||
|
||||
PyDoc_STRVAR(resource_getrusage__doc__,
|
||||
"getrusage($module, who, /)\n"
|
||||
"--\n"
|
||||
|
@ -29,6 +31,8 @@ exit:
|
|||
return return_value;
|
||||
}
|
||||
|
||||
#endif /* defined(HAVE_GETRUSAGE) */
|
||||
|
||||
PyDoc_STRVAR(resource_getrlimit__doc__,
|
||||
"getrlimit($module, resource, /)\n"
|
||||
"--\n"
|
||||
|
@ -160,7 +164,11 @@ exit:
|
|||
return return_value;
|
||||
}
|
||||
|
||||
#ifndef RESOURCE_GETRUSAGE_METHODDEF
|
||||
#define RESOURCE_GETRUSAGE_METHODDEF
|
||||
#endif /* !defined(RESOURCE_GETRUSAGE_METHODDEF) */
|
||||
|
||||
#ifndef RESOURCE_PRLIMIT_METHODDEF
|
||||
#define RESOURCE_PRLIMIT_METHODDEF
|
||||
#endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */
|
||||
/*[clinic end generated code: output=ad190fb33d647d1e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=9ce1886c129eb2f3 input=a9049054013a1b77]*/
|
||||
|
|
|
@ -881,7 +881,7 @@ fail:
|
|||
#define _PyLong_FromDev PyLong_FromLongLong
|
||||
|
||||
|
||||
#if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
|
||||
#if (defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)) || defined(HAVE_DEVICE_MACROS)
|
||||
static int
|
||||
_Py_Dev_Converter(PyObject *obj, void *p)
|
||||
{
|
||||
|
@ -890,7 +890,7 @@ _Py_Dev_Converter(PyObject *obj, void *p)
|
|||
return 0;
|
||||
return 1;
|
||||
}
|
||||
#endif /* HAVE_MKNOD && HAVE_MAKEDEV */
|
||||
#endif /* (HAVE_MKNOD && HAVE_MAKEDEV) || HAVE_DEVICE_MACROS */
|
||||
|
||||
|
||||
#ifdef AT_FDCWD
|
||||
|
|
|
@ -78,6 +78,7 @@ get_resource_state(PyObject *module)
|
|||
|
||||
static struct PyModuleDef resourcemodule;
|
||||
|
||||
#ifdef HAVE_GETRUSAGE
|
||||
/*[clinic input]
|
||||
resource.getrusage
|
||||
|
||||
|
@ -134,6 +135,7 @@ resource_getrusage_impl(PyObject *module, int who)
|
|||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
py2rlimit(PyObject *limits, struct rlimit *rl_out)
|
||||
|
|
|
@ -1282,7 +1282,7 @@ _PyTime_GetProcessTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
|
|||
#endif
|
||||
|
||||
/* getrusage(RUSAGE_SELF) */
|
||||
#if defined(HAVE_SYS_RESOURCE_H)
|
||||
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRUSAGE)
|
||||
struct rusage ru;
|
||||
|
||||
if (getrusage(RUSAGE_SELF, &ru) == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue