1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
--- contrib/deprecated/python/win-unicode-console/win_unicode_console/__init__.py (index)
+++ contrib/deprecated/python/win-unicode-console/win_unicode_console/__init__.py (working tree)
@@ -1,5 +1,5 @@
-from . import streams, console, readline_hook
+from . import streams, console #, readline_hook
from .info import WINDOWS, PY2
if PY2:
@@ -14,7 +14,7 @@ def enable(
stdin = Ellipsis,
stdout = Ellipsis,
stderr = Ellipsis,
- use_readline_hook = True,
+ use_readline_hook = False,
use_pyreadline = True,
use_raw_input = True, # PY2
raw_input__return_unicode = raw_input.RETURN_UNICODE if PY2 else None,
@@ -27,8 +27,8 @@ def enable(
streams.enable(stdin=stdin, stdout=stdout, stderr=stderr)
- if use_readline_hook:
- readline_hook.enable(use_pyreadline=use_pyreadline)
+ #if use_readline_hook:
+ # readline_hook.enable(use_pyreadline=use_pyreadline)
if PY2 and use_raw_input:
raw_input.enable(raw_input__return_unicode)
@@ -50,5 +50,5 @@ def disable():
unicode_argv.disable()
raw_input.disable()
- readline_hook.disable()
+ #readline_hook.disable()
streams.disable()
--- contrib/deprecated/python/win-unicode-console/win_unicode_console/readline_hook.py (index)
+++ contrib/deprecated/python/win-unicode-console/win_unicode_console/readline_hook.py (working tree)
@@ -38,7 +38,7 @@ strncpy.argtypes = [c_char_p, c_char_p, c_size_t]
HOOKFUNC = CFUNCTYPE(c_char_p, c_void_p, c_void_p, c_char_p)
-PyOS_ReadlineFunctionPointer = c_void_p.in_dll(pythonapi, "PyOS_ReadlineFunctionPointer")
+#PyOS_ReadlineFunctionPointer = c_void_p.in_dll(pythonapi, "PyOS_ReadlineFunctionPointer")
def new_zero_terminated_string(b):
@@ -63,7 +63,7 @@ class ReadlineHookManager:
def __init__(self):
self.readline_wrapper_ref = HOOKFUNC(self.readline_wrapper)
self.address = cast(self.readline_wrapper_ref, c_void_p).value
- self.original_address = PyOS_ReadlineFunctionPointer.value
+ #self.original_address = PyOS_ReadlineFunctionPointer.value
self.readline_hook = None
def readline_wrapper(self, stdin, stdout, prompt):
|