https://github.com/python/cpython/commit/9162340e0627d0cb0bc8e8c72f1aa53f5556897b
commit: 9162340e0627d0cb0bc8e8c72f1aa53f5556897b
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2024-11-13T17:19:03Z
summary:

[3.13] gh-126456: Fix _pyrepl curses tigetstr() (GH-126472) (#126790)

gh-126456: Fix _pyrepl curses tigetstr() (GH-126472)
(cherry picked from commit b2bbdc56e3276f3b37ea5cf5f73f49c4cce6d9f6)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Lib/_pyrepl/_minimal_curses.py

diff --git a/Lib/_pyrepl/_minimal_curses.py b/Lib/_pyrepl/_minimal_curses.py
index 849617bf7585e4..d884f880f50ac7 100644
--- a/Lib/_pyrepl/_minimal_curses.py
+++ b/Lib/_pyrepl/_minimal_curses.py
@@ -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
@@ -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
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to