mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-40826: Fix test_repl.test_close_stdin() on Windows (GH-20779)
test_repl.test_close_stdin() now calls support.suppress_msvcrt_asserts() to fix the test on Windows. * Move suppress_msvcrt_asserts() from test.libregrtest.setup to test.support. Make its verbose parameter optional: verbose=False by default. * Add msvcrt.GetErrorMode(). * SuppressCrashReport now uses GetErrorMode() and SetErrorMode() of the msvcrt module, rather than using ctypes. * Remove also an unused variable (deadline) in wait_process().
This commit is contained in:
parent
d36cf5f1d2
commit
f6e58aefde
6 changed files with 81 additions and 49 deletions
20
PC/clinic/msvcrtmodule.c.h
generated
20
PC/clinic/msvcrtmodule.c.h
generated
|
|
@ -590,6 +590,24 @@ exit:
|
|||
|
||||
#endif /* defined(_DEBUG) */
|
||||
|
||||
PyDoc_STRVAR(msvcrt_GetErrorMode__doc__,
|
||||
"GetErrorMode($module, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Wrapper around GetErrorMode.");
|
||||
|
||||
#define MSVCRT_GETERRORMODE_METHODDEF \
|
||||
{"GetErrorMode", (PyCFunction)msvcrt_GetErrorMode, METH_NOARGS, msvcrt_GetErrorMode__doc__},
|
||||
|
||||
static PyObject *
|
||||
msvcrt_GetErrorMode_impl(PyObject *module);
|
||||
|
||||
static PyObject *
|
||||
msvcrt_GetErrorMode(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return msvcrt_GetErrorMode_impl(module);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(msvcrt_SetErrorMode__doc__,
|
||||
"SetErrorMode($module, mode, /)\n"
|
||||
"--\n"
|
||||
|
|
@ -629,4 +647,4 @@ exit:
|
|||
#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
|
||||
#define MSVCRT_SET_ERROR_MODE_METHODDEF
|
||||
#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
|
||||
/*[clinic end generated code: output=ab3b5ce5c1447f0e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=20dfbc768edce7c0 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
|
|
@ -482,6 +482,25 @@ msvcrt_set_error_mode_impl(PyObject *module, int mode)
|
|||
}
|
||||
#endif /* _DEBUG */
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.GetErrorMode
|
||||
|
||||
Wrapper around GetErrorMode.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
msvcrt_GetErrorMode_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=3103fc6145913591 input=5a7fb083b6dd71fd]*/
|
||||
{
|
||||
unsigned int res;
|
||||
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
res = GetErrorMode();
|
||||
_Py_END_SUPPRESS_IPH
|
||||
|
||||
return PyLong_FromUnsignedLong(res);
|
||||
}
|
||||
|
||||
/*[clinic input]
|
||||
msvcrt.SetErrorMode
|
||||
|
||||
|
|
@ -520,6 +539,7 @@ static struct PyMethodDef msvcrt_functions[] = {
|
|||
MSVCRT_GETCHE_METHODDEF
|
||||
MSVCRT_PUTCH_METHODDEF
|
||||
MSVCRT_UNGETCH_METHODDEF
|
||||
MSVCRT_GETERRORMODE_METHODDEF
|
||||
MSVCRT_SETERRORMODE_METHODDEF
|
||||
MSVCRT_CRTSETREPORTFILE_METHODDEF
|
||||
MSVCRT_CRTSETREPORTMODE_METHODDEF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue