mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-9495: avoid confusing chained exception in argparse test (GH-17120)
This commit is contained in:
parent
424e5686d8
commit
d4331c56b4
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue