summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
authoralclarks <57201106+alclarks@users.noreply.github.com>2020-02-21 08:48:36 (GMT)
committerGitHub <noreply@github.com>2020-02-21 08:48:36 (GMT)
commitd4331c56b4f6fe6f18caf19fc1ecf9fec14f7066 (patch)
treea59aa7ddc37597e23e29a1a29dfb7597bcd695c4 /Lib/test/test_argparse.py
parent424e5686d82235e08f8108b8bbe034bc91421689 (diff)
downloadcpython-d4331c56b4f6fe6f18caf19fc1ecf9fec14f7066.zip
cpython-d4331c56b4f6fe6f18caf19fc1ecf9fec14f7066.tar.gz
cpython-d4331c56b4f6fe6f18caf19fc1ecf9fec14f7066.tar.bz2
bpo-9495: avoid confusing chained exception in argparse test (GH-17120)
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index b095783..9899a53 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -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