gh-109266: Fix msvcrt.kbhit's documented return value (GH-109267)
This commit is contained in:
parent
42ab2cbd7b
commit
e121fca33b
@ -98,7 +98,8 @@ Console I/O
|
|||||||
|
|
||||||
.. function:: kbhit()
|
.. function:: kbhit()
|
||||||
|
|
||||||
Return ``True`` if a keypress is waiting to be read.
|
Returns a nonzero value if a keypress is waiting to be read. Otherwise,
|
||||||
|
return 0.
|
||||||
|
|
||||||
|
|
||||||
.. function:: getch()
|
.. function:: getch()
|
||||||
|
4
PC/clinic/msvcrtmodule.c.h
generated
4
PC/clinic/msvcrtmodule.c.h
generated
@ -201,7 +201,7 @@ PyDoc_STRVAR(msvcrt_kbhit__doc__,
|
|||||||
"kbhit($module, /)\n"
|
"kbhit($module, /)\n"
|
||||||
"--\n"
|
"--\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Return true if a keypress is waiting to be read.");
|
"Returns a nonzero value if a keypress is waiting to be read. Otherwise, return 0.");
|
||||||
|
|
||||||
#define MSVCRT_KBHIT_METHODDEF \
|
#define MSVCRT_KBHIT_METHODDEF \
|
||||||
{"kbhit", (PyCFunction)msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__},
|
{"kbhit", (PyCFunction)msvcrt_kbhit, METH_NOARGS, msvcrt_kbhit__doc__},
|
||||||
@ -695,4 +695,4 @@ exit:
|
|||||||
#ifndef MSVCRT_GETERRORMODE_METHODDEF
|
#ifndef MSVCRT_GETERRORMODE_METHODDEF
|
||||||
#define MSVCRT_GETERRORMODE_METHODDEF
|
#define MSVCRT_GETERRORMODE_METHODDEF
|
||||||
#endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */
|
#endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */
|
||||||
/*[clinic end generated code: output=97e00f191821d4c0 input=a9049054013a1b77]*/
|
/*[clinic end generated code: output=525ec6ac4e3cb4f2 input=a9049054013a1b77]*/
|
||||||
|
@ -220,12 +220,12 @@ msvcrt_get_osfhandle_impl(PyObject *module, int fd)
|
|||||||
/*[clinic input]
|
/*[clinic input]
|
||||||
msvcrt.kbhit -> long
|
msvcrt.kbhit -> long
|
||||||
|
|
||||||
Return true if a keypress is waiting to be read.
|
Returns a nonzero value if a keypress is waiting to be read. Otherwise, return 0.
|
||||||
[clinic start generated code]*/
|
[clinic start generated code]*/
|
||||||
|
|
||||||
static long
|
static long
|
||||||
msvcrt_kbhit_impl(PyObject *module)
|
msvcrt_kbhit_impl(PyObject *module)
|
||||||
/*[clinic end generated code: output=940dfce6587c1890 input=e70d678a5c2f6acc]*/
|
/*[clinic end generated code: output=940dfce6587c1890 input=d0f4cb3289ff51e2]*/
|
||||||
{
|
{
|
||||||
return _kbhit();
|
return _kbhit();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user