Skip to content

Commit 9162340

Browse files
[3.13] gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (#126790)
gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (cherry picked from commit b2bbdc5) Co-authored-by: Victor Stinner <[email protected]>
1 parent e8dbe7e commit 9162340

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/_pyrepl/_minimal_curses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _find_clib() -> str:
3434
clib.setupterm.restype = ctypes.c_int
3535

3636
clib.tigetstr.argtypes = [ctypes.c_char_p]
37-
clib.tigetstr.restype = ctypes.POINTER(ctypes.c_char)
37+
clib.tigetstr.restype = ctypes.c_ssize_t
3838

3939
clib.tparm.argtypes = [ctypes.c_char_p] + 9 * [ctypes.c_int] # type: ignore[operator]
4040
clib.tparm.restype = ctypes.c_char_p
@@ -56,7 +56,7 @@ def tigetstr(cap):
5656
if not isinstance(cap, bytes):
5757
cap = cap.encode("ascii")
5858
result = clib.tigetstr(cap)
59-
if ctypes.cast(result, ctypes.c_void_p).value == ERR:
59+
if result == ERR:
6060
return None
6161
return ctypes.cast(result, ctypes.c_char_p).value
6262

0 commit comments

Comments
 (0)