mirror of https://github.com/python/cpython
bpo-9495: avoid confusing chained exception in argparse test (GH-17120)
This commit is contained in:
parent
424e5686d8
commit
d4331c56b4
|
@ -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…
Reference in New Issue