##// END OF EJS Templates
fixed rlineimpl to work properly with py2exed pyreadline
vivainio -
Show More
@@ -15,12 +15,17 b' try:'
15 import readline as _rl
15 import readline as _rl
16 have_readline = True
16 have_readline = True
17 except ImportError:
17 except ImportError:
18 try:
19 from pyreadline import *
20 import pyreadline as _rl
21 have_readline = True
22 except ImportError:
18 have_readline = False
23 have_readline = False
19
24
20 if sys.platform == 'win32' and have_readline:
25 if sys.platform == 'win32' and have_readline:
21 try:
26 try:
22 _outputfile=_rl.GetOutputFile()
27 _outputfile=_rl.GetOutputFile()
23 except NameError:
28 except AttributeError:
24 print "Failed GetOutputFile"
29 print "Failed GetOutputFile"
25 have_readline = False
30 have_readline = False
26
31
@@ -31,10 +36,8 b" if sys.platform == 'win32' and have_readline:"
31 # has the original discussion.
36 # has the original discussion.
32
37
33 if have_readline:
38 if have_readline:
34 import readline
35 try:
39 try:
36 readline.clear_history
40 _rl.clear_history
37 except AttributeError:
41 except AttributeError:
38 def clear_history(): pass
42 def clear_history(): pass
39 readline.clear_history = clear_history
43 _rl.clear_history = clear_history No newline at end of file
40 del readline
General Comments 0
You need to be logged in to leave comments. Login now