bpo-9495: avoid confusing chained exception in argparse test (GH-17120)

This commit is contained in:
alclarks 2020-02-21 08:48:36 +00:00 committed by GitHub
parent 424e5686d8
commit d4331c56b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -105,7 +105,8 @@ def stderr_to_parser_error(parse_args, *args, **kwargs):
code = sys.exc_info()[1].code
stdout = sys.stdout.getvalue()
stderr = sys.stderr.getvalue()
raise ArgumentParserError("SystemExit", stdout, stderr, code)
raise ArgumentParserError(
"SystemExit", stdout, stderr, code) from None
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr

View File

@ -312,6 +312,7 @@ Gilles Civario
Chris Clark
Diana Clarke
Laurie Clark-Michalek
Alexander Clarkson
Mike Clarkson
Andrew Clegg
Brad Clements