Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97893:97cf5afa67c7
Date: 2019-10-30 20:00 +0200
http://bitbucket.org/pypy/pypy/changeset/97cf5afa67c7/
Log: issue 2971: update from upstream package, should fix failing tests
diff --git a/extra_tests/test_pyrepl/infrastructure.py
b/extra_tests/test_pyrepl/infrastructure.py
--- a/extra_tests/test_pyrepl/infrastructure.py
+++ b/extra_tests/test_pyrepl/infrastructure.py
@@ -59,6 +59,11 @@
return Event(*ev)
+ def getpending(self):
+ """Nothing pending, but do not return None here."""
+ return Event('key', '', b'')
+
+
class BaseTestReader(Reader):
def get_prompt(self, lineno, cursor_on_line):
diff --git a/extra_tests/test_pyrepl/test_readline.py
b/extra_tests/test_pyrepl/test_readline.py
--- a/extra_tests/test_pyrepl/test_readline.py
+++ b/extra_tests/test_pyrepl/test_readline.py
@@ -15,8 +15,7 @@
os.write(master, b'input\n')
with sane_term():
- result = readline_wrapper.get_reader().readline()
- #result = readline_wrapper.raw_input('prompt:')
+ result = readline_wrapper.raw_input('prompt:')
assert result == 'input'
# A bytes string on python2, a unicode string on python3.
assert isinstance(result, str)
diff --git a/extra_tests/test_pyrepl/test_wishes.py
b/extra_tests/test_pyrepl/test_wishes.py
--- a/extra_tests/test_pyrepl/test_wishes.py
+++ b/extra_tests/test_pyrepl/test_wishes.py
@@ -27,5 +27,5 @@
read_spec([
(('digit-arg', '3'), ['']),
(('quoted-insert', None), ['']),
- (('self-insert', '\033'), ['^[^[^[']),
+ (('key', '\033'), ['^[^[^[']),
(('accept', None), None)])
diff --git a/lib_pypy/pyrepl/commands.py b/lib_pypy/pyrepl/commands.py
--- a/lib_pypy/pyrepl/commands.py
+++ b/lib_pypy/pyrepl/commands.py
@@ -369,8 +369,12 @@
class qIHelp(Command):
def do(self):
+ from .reader import disp_str
+
r = self.reader
- r.insert((self.event + r.console.getpending().data) * r.get_arg())
+ pending = r.console.getpending().data
+ disp = disp_str((self.event + pending).encode())[0]
+ r.insert(disp * r.get_arg())
r.pop_input_trans()
from pyrepl import input
diff --git a/lib_pypy/pyrepl/readline.py b/lib_pypy/pyrepl/readline.py
--- a/lib_pypy/pyrepl/readline.py
+++ b/lib_pypy/pyrepl/readline.py
@@ -259,7 +259,7 @@
except _error:
return _old_raw_input(prompt)
reader.ps1 = prompt
- return reader.readline(reader, startup_hook=self.startup_hook)
+ return reader.readline(returns_unicode=True,
startup_hook=self.startup_hook)
def multiline_input(self, more_lines, ps1, ps2, returns_unicode=False):
"""Read an input on possibly multiple lines, asking for more
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit