mirror of
https://github.com/python/cpython.git
synced 2025-11-02 14:41:33 +00:00
gh-126456: Fix _pyrepl curses tigetstr() (#126472)
This commit is contained in:
parent
d00878b06a
commit
b2bbdc56e3
1 changed files with 2 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ def _find_clib() -> str:
|
||||||
clib.setupterm.restype = ctypes.c_int
|
clib.setupterm.restype = ctypes.c_int
|
||||||
|
|
||||||
clib.tigetstr.argtypes = [ctypes.c_char_p]
|
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.argtypes = [ctypes.c_char_p] + 9 * [ctypes.c_int] # type: ignore[operator]
|
||||||
clib.tparm.restype = ctypes.c_char_p
|
clib.tparm.restype = ctypes.c_char_p
|
||||||
|
|
@ -56,7 +56,7 @@ def tigetstr(cap):
|
||||||
if not isinstance(cap, bytes):
|
if not isinstance(cap, bytes):
|
||||||
cap = cap.encode("ascii")
|
cap = cap.encode("ascii")
|
||||||
result = clib.tigetstr(cap)
|
result = clib.tigetstr(cap)
|
||||||
if ctypes.cast(result, ctypes.c_void_p).value == ERR:
|
if result == ERR:
|
||||||
return None
|
return None
|
||||||
return ctypes.cast(result, ctypes.c_char_p).value
|
return ctypes.cast(result, ctypes.c_char_p).value
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue