mirror of
https://github.com/wassname/pyreadline.git
synced 2026-07-05 17:30:51 +08:00
Fix for loading msvcrt in ctypes on python <2.6. Provided by Cristoph Gohlke
This commit is contained in:
@@ -599,8 +599,10 @@ class Console(object):
|
||||
for func in funcs:
|
||||
setattr(Console, func, getattr(windll.kernel32, func))
|
||||
|
||||
|
||||
msvcrt = cdll.LoadLibrary(ctypes.util.find_msvcrt())
|
||||
if sys.version_info[:2] < (2, 6):
|
||||
msvcrt = cdll.msvcrt
|
||||
else:
|
||||
msvcrt = cdll.LoadLibrary(ctypes.util.find_msvcrt())
|
||||
_strncpy = msvcrt.strncpy
|
||||
_strncpy.restype = c_char_p
|
||||
_strncpy.argtypes = [c_char_p, c_char_p, c_size_t]
|
||||
|
||||
Reference in New Issue
Block a user