mirror of
https://github.com/wassname/pyreadline.git
synced 2026-06-27 16:10:38 +08:00
Ensure add_history adds unicode string
This commit is contained in:
@@ -98,6 +98,7 @@ class LineHistory(object):
|
||||
|
||||
def add_history(self, line):
|
||||
'''Append a line to the history buffer, as if it was the last line typed.'''
|
||||
line = ensure_unicode(line)
|
||||
if not hasattr(line, "get_line_text"):
|
||||
line = lineobj.ReadLineTextBuffer(line)
|
||||
if not line.get_line_text():
|
||||
|
||||
Reference in New Issue
Block a user