You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git i/pyrepl/completing_reader.py w/pyrepl/completing_reader.py
index 6039688..1e456cc 100644
--- i/pyrepl/completing_reader.py+++ w/pyrepl/completing_reader.py@@ -265,13 +265,15 @@ def get_completions(self, stem):
def test():
+ from pyrepl.unix_console import UnixConsole+
class TestReader(CompletingReader):
def get_completions(self, stem):
return [s for l in self.history
for s in l.split()
if s and s.startswith(stem)]
- reader = TestReader()+ reader = TestReader(UnixConsole())
reader.ps1 = "c**> "
reader.ps2 = "c/*> "
reader.ps3 = "c|*> "
But then using e.g. Up crashes:
% python -m pyrepl.completing_reader
c**> Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "…/src/pyrepl/pyrepl/completing_reader.py", line 286, in <module>
test()
File "…/src/pyrepl/pyrepl/completing_reader.py", line 281, in test
while reader.readline():
File "…/src/pyrepl/pyrepl/reader.py", line 605, in readline
self.handle1()
File "…/src/pyrepl/pyrepl/reader.py", line 588, in handle1
self.do_cmd(cmd)
File "…/src/pyrepl/pyrepl/reader.py", line 535, in do_cmd
cmd.do()
File "…/src/pyrepl/pyrepl/commands.py", line 210, in do
if r.historyi > 0:
AttributeError: 'TestReader' object has no attribute 'historyi'
Not sure how useful (the test/__main__ in) completing_reader.py is in the end though..
The text was updated successfully, but these errors were encountered:
The following patch fixes it (based on
pyrepl/pyrepl/historical_reader.py
Lines 301 to 303 in b55cc6d
But then using e.g. Up crashes:
Not sure how useful (the test/
__main__
in)completing_reader.py
is in the end though..The text was updated successfully, but these errors were encountered: