Skip to content

Commit d4331c5

Browse files
authored
bpo-9495: avoid confusing chained exception in argparse test (GH-17120)
1 parent 424e568 commit d4331c5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/test/test_argparse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ def stderr_to_parser_error(parse_args, *args, **kwargs):
105105
code = sys.exc_info()[1].code
106106
stdout = sys.stdout.getvalue()
107107
stderr = sys.stderr.getvalue()
108-
raise ArgumentParserError("SystemExit", stdout, stderr, code)
108+
raise ArgumentParserError(
109+
"SystemExit", stdout, stderr, code) from None
109110
finally:
110111
sys.stdout = old_stdout
111112
sys.stderr = old_stderr

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ Gilles Civario
312312
Chris Clark
313313
Diana Clarke
314314
Laurie Clark-Michalek
315+
Alexander Clarkson
315316
Mike Clarkson
316317
Andrew Clegg
317318
Brad Clements

0 commit comments

Comments
 (0)