Skip to content

Commit

Permalink
[3.13] gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (#126790)
Browse files Browse the repository at this point in the history
gh-126456: Fix _pyrepl curses tigetstr() (GH-126472)
(cherry picked from commit b2bbdc5)

Co-authored-by: Victor Stinner <[email protected]>
  • Loading branch information
miss-islington and vstinner authored Nov 13, 2024
1 parent e8dbe7e commit 9162340
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 9162340

Please sign in to comment.