Skip to content

Commit 1de3b7d

Browse files
aiskvstinner
authored andcommitted
pythongh-109266: Fix msvcrt.kbhit's documented return value (pythonGH-109267)
1 parent 44ad9c0 commit 1de3b7d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Doc/library/msvcrt.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ Console I/O
9898

9999
.. function:: kbhit()
100100

101-
Return ``True`` if a keypress is waiting to be read.
101+
Returns a nonzero value if a keypress is waiting to be read. Otherwise,
102+
return 0.
102103

103104

104105
.. function:: getch()

PC/clinic/msvcrtmodule.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PC/msvcrtmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ msvcrt_get_osfhandle_impl(PyObject *module, int fd)
220220
/*[clinic input]
221221
msvcrt.kbhit -> long
222222
223-
Return true if a keypress is waiting to be read.
223+
Returns a nonzero value if a keypress is waiting to be read. Otherwise, return 0.
224224
[clinic start generated code]*/
225225

226226
static long
227227
msvcrt_kbhit_impl(PyObject *module)
228-
/*[clinic end generated code: output=940dfce6587c1890 input=e70d678a5c2f6acc]*/
228+
/*[clinic end generated code: output=940dfce6587c1890 input=d0f4cb3289ff51e2]*/
229229
{
230230
return _kbhit();
231231
}

0 commit comments

Comments
 (0)