mirror of
https://github.com/wassname/pyreadline.git
synced 2026-08-04 13:13:32 +08:00
@@ -98,6 +98,7 @@ class LineHistory(object):
|
|||||||
|
|
||||||
def add_history(self, line):
|
def add_history(self, line):
|
||||||
'''Append a line to the history buffer, as if it was the last line typed.'''
|
'''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"):
|
if not hasattr(line, "get_line_text"):
|
||||||
line = lineobj.ReadLineTextBuffer(line)
|
line = lineobj.ReadLineTextBuffer(line)
|
||||||
if not line.get_line_text():
|
if not line.get_line_text():
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from __future__ import print_function, unicode_literals, absolute_import
|
|||||||
import logging
|
import logging
|
||||||
import logging.handlers
|
import logging.handlers
|
||||||
import struct, socket
|
import struct, socket
|
||||||
from .unicode_helper import ensure_unicode
|
from pyreadline.unicode_helper import ensure_unicode
|
||||||
try:
|
try:
|
||||||
import msvcrt
|
import msvcrt
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|||||||
Reference in New Issue
Block a user