mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.10] bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27006)
(cherry picked from commit d968a638fc
)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
parent
0856134542
commit
33022f9e86
3 changed files with 21 additions and 1 deletions
|
@ -1800,6 +1800,21 @@ def bœr():
|
|||
'(Pdb) ',
|
||||
])
|
||||
|
||||
def test_issue34266(self):
|
||||
'''do_run handles exceptions from parsing its arg'''
|
||||
def check(bad_arg, msg):
|
||||
commands = "\n".join([
|
||||
f'run {bad_arg}',
|
||||
'q',
|
||||
])
|
||||
stdout, _ = self.run_pdb_script('pass', commands + '\n')
|
||||
self.assertEqual(stdout.splitlines()[1:], [
|
||||
'-> pass',
|
||||
f'(Pdb) *** Cannot run {bad_arg}: {msg}',
|
||||
'(Pdb) ',
|
||||
])
|
||||
check('\\', 'No escaped character')
|
||||
check('"', 'No closing quotation')
|
||||
|
||||
def test_issue42384(self):
|
||||
'''When running `python foo.py` sys.path[0] is an absolute path. `python -m pdb foo.py` should behave the same'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue