From 94d2539dfc4af87a89e2c84c4c9f6a9be78e8e28 Mon Sep 17 00:00:00 2001 From: Jorgen Stenarson Date: Thu, 6 Oct 2011 21:48:31 +0200 Subject: [PATCH] Bad fix for crash on python3, some conflict with 64-bit fix and _strncpy. Removed restype and argtypes on _strncpy for python3. --- pyreadline/console/console.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyreadline/console/console.py b/pyreadline/console/console.py index 17f5b7d..328850e 100644 --- a/pyreadline/console/console.py +++ b/pyreadline/console/console.py @@ -606,9 +606,11 @@ 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] +if sys.version [:1] == 2: #Bad fix for crash on python3 + _strncpy.restype = c_char_p + _strncpy.argtypes = [c_char_p, c_char_p, c_size_t] _strdup = msvcrt._strdup _strdup.restype = c_char_p _strdup.argtypes = [c_char_p]