File tree 2 files changed +25
-2
lines changed
2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -1408,6 +1408,28 @@ def test_pdb_issue_gh_91742():
1408
1408
Author: 'pi' Version: '3.14'
1409
1409
"""
1410
1410
1411
+ def test_pdb_issue_gh_101517 ():
1412
+ """See GH-101517
1413
+
1414
+ breakpoint in except* clause
1415
+
1416
+ >>> def test_function():
1417
+ ... try:
1418
+ ... raise ExceptionGroup("eg", [KeyError(), ValueError()])
1419
+ ... except* KeyError:
1420
+ ... breakpoint()
1421
+ ...
1422
+ >>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
1423
+ ... 'continue'
1424
+ ... ]):
1425
+ ... try:
1426
+ ... test_function()
1427
+ ... except Exception as e:
1428
+ ... print(repr(e))
1429
+ ExceptionGroup('eg', [ValueError()])
1430
+ >>>
1431
+ """
1432
+
1411
1433
def test_pdb_issue_gh_94215 ():
1412
1434
"""See GH-94215
1413
1435
Original file line number Diff line number Diff line change @@ -3747,9 +3747,10 @@ compiler_try_star_except(struct compiler *c, stmt_ty s)
3747
3747
USE_LABEL (c , except );
3748
3748
3749
3749
if (i == n - 1 ) {
3750
+ loc = location_of_last_executing_statement (handler -> v .ExceptHandler .body );
3750
3751
/* Add exc to the list (if not None it's the unhandled part of the EG) */
3751
- ADDOP_I (c , NO_LOCATION , LIST_APPEND , 1 );
3752
- ADDOP_JUMP (c , NO_LOCATION , JUMP , reraise_star );
3752
+ ADDOP_I (c , loc , LIST_APPEND , 1 );
3753
+ ADDOP_JUMP (c , loc , JUMP , reraise_star );
3753
3754
}
3754
3755
}
3755
3756
/* artificial */
You can’t perform that action at this time.
0 commit comments