Skip to content

Commit

Permalink
gh-126456: Fix _pyrepl curses tigetstr() (#126472)
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner authored Nov 13, 2024
1 parent d00878b commit b2bbdc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/_pyrepl/_minimal_curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def _find_clib() -> str:
clib.setupterm.restype = ctypes.c_int

clib.tigetstr.argtypes = [ctypes.c_char_p]
clib.tigetstr.restype = ctypes.POINTER(ctypes.c_char)
clib.tigetstr.restype = ctypes.c_ssize_t

clib.tparm.argtypes = [ctypes.c_char_p] + 9 * [ctypes.c_int] # type: ignore[operator]
clib.tparm.restype = ctypes.c_char_p
Expand All @@ -56,7 +56,7 @@ def tigetstr(cap):
if not isinstance(cap, bytes):
cap = cap.encode("ascii")
result = clib.tigetstr(cap)
if ctypes.cast(result, ctypes.c_void_p).value == ERR:
if result == ERR:
return None
return ctypes.cast(result, ctypes.c_char_p).value

Expand Down

0 comments on commit b2bbdc5

Please sign in to comment.