Skip to content

Commit bd3f635

Browse files
committed
Pass correct number of arguments to commands.
Fixes issue #4.
1 parent bb77977 commit bd3f635

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pyrepl/reader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def do_cmd(self, cmd):
526526
cmd = self.commands.get(cmd[0],
527527
commands.invalid_command)(self, *cmd)
528528
elif isinstance(cmd[0], type):
529-
cmd = cmd[0](self, cmd)
529+
cmd = cmd[0](self, *cmd)
530530
else:
531531
return # nothing to do
532532

testing/test_bugs.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,26 @@
1717
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1818
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1919

20-
from .infrastructure import EA, read_spec
20+
from pyrepl.historical_reader import HistoricalReader
21+
from .infrastructure import EA, TestReader, read_spec
2122

2223
# this test case should contain as-verbatim-as-possible versions of
2324
# (applicable) bug reports
2425

2526
import pytest
2627

28+
class HistoricalTestReader(HistoricalReader, TestReader):
29+
pass
30+
2731
@pytest.mark.xfail(reason='event missing', run=False)
2832
def test_transpose_at_start():
2933
read_spec([( 'transpose', [EA, '']),
3034
( 'accept', [''])])
3135

36+
def test_cmd_instantiation_crash():
37+
spec = [
38+
('reverse-history-isearch', ["(r-search `') "]),
39+
(('key', 'left'), ['']),
40+
('accept', [''])
41+
]
42+
read_spec(spec, HistoricalTestReader)

0 commit comments

Comments
 (0)