summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-11-13 16:46:10 (GMT)
committerGitHub <noreply@github.com>2024-11-13 16:46:10 (GMT)
commitb2bbdc56e3276f3b37ea5cf5f73f49c4cce6d9f6 (patch)
treea2e3ca25153340f5e8893065c5c41478062bcb41 /Lib
parentd00878b06a05ea04790813dba70b09cc1d11bf45 (diff)
downloadcpython-b2bbdc56e3276f3b37ea5cf5f73f49c4cce6d9f6.zip
cpython-b2bbdc56e3276f3b37ea5cf5f73f49c4cce6d9f6.tar.gz
cpython-b2bbdc56e3276f3b37ea5cf5f73f49c4cce6d9f6.tar.bz2
gh-126456: Fix _pyrepl curses tigetstr() (#126472)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/_pyrepl/_minimal_curses.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_pyrepl/_minimal_curses.py b/Lib/_pyrepl/_minimal_curses.py
index 849617b..d884f88 100644
--- a/Lib/_pyrepl/_minimal_curses.py
+++ b/Lib/_pyrepl/_minimal_curses.py
@@ -34,7 +34,7 @@ clib.setupterm.argtypes = [ctypes.c_char_p, ctypes.c_int, ctypes.POINTER(ctypes.
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
@@ -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