Skip to content

Commit b2bbdc5

Browse files
authored
gh-126456: Fix _pyrepl curses tigetstr() (#126472)
1 parent d00878b commit b2bbdc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/_pyrepl/_minimal_curses.py

+2-2
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)