test_pyrepl.test_functional:test_syntaxerror_correct_filename_and_positions
def test_syntaxerror_correct_filename_and_positions():
with start_repl(colors=False) as child:
child.sendline('a bbbb c')
> child.expect(' File "<python-input-0>", line 1')
../build/extra_tests/test_pyrepl/test_functional.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pypy-venv/lib/pypy3.12/site-packages/pexpect/spawnbase.py:354: in expect
return self.expect_list(compiled_pattern_list,
pypy-venv/lib/pypy3.12/site-packages/pexpect/spawnbase.py:383: in expect_list
return exp.expect_loop(timeout)
pypy-venv/lib/pypy3.12/site-packages/pexpect/expect.py:179: in expect_loop
return self.eof(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pexpect.expect.Expecter object at 0x13c16c30>
err = EOF('End Of File (EOF). Exception style platform.')
def eof(self, err=None):
spawn = self.spawn
spawn.before = spawn._before.getvalue()
spawn._buffer = spawn.buffer_type()
spawn._before = spawn.buffer_type()
spawn.after = EOF
index = self.searcher.eof_index
if index >= 0:
spawn.match = EOF
spawn.match_index = index
return index
else:
spawn.match = None
spawn.match_index = None
msg = str(spawn)
msg += '\nsearcher: %s' % self.searcher
if err is not None:
msg = str(err) + '\n' + msg
exc = EOF(msg)
exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
> raise exc
E pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
E <pexpect.pty_spawn.spawn object at 0x13c16a30>
E command: /build_dir/pypy-c-jit-linux-x86-32/venv/pypy-venv/bin/pypy3
E args: [b'/build_dir/pypy-c-jit-linux-x86-32/venv/pypy-venv/bin/pypy3']
E buffer (last 100 chars): ''
E before (last 100 chars): ")\r\nTypeError: InteractiveInterpreter.showsyntaxerror() got an unexpected keyword argument 'source'\r\n"
E after: <class 'pexpect.exceptions.EOF'>
E match: None
E match_index: None
E exitstatus: None
E flag_eof: True
E pid: 2172925
E child_fd: 30
E closed: False
E timeout: 10
E delimiter: <class 'pexpect.exceptions.EOF'>
E logfile: <_io.TextIOWrapper name="<_io.FileIO name=7 mode='rb+' closefd=True>" mode='r+' encoding='utf-8'>
E logfile_read: None
E logfile_send: None
E maxread: 2000
E ignorecase: False
E searchwindowsize: None
E delaybeforesend: 0.05
E delayafterclose: 0.1
E delayafterterminate: 0.1
E searcher: searcher_re:
E 0: re.compile(' File "<python-input-0>", line 1')
pypy-venv/lib/pypy3.12/site-packages/pexpect/expect.py:122: EOF
builder: pypy-c-jit-linux-x86-32 build #8377+
test: test_pyrepl.test_functional:test_syntaxerror_correct_filename_and_positions