summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-11-11 07:53:47 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-11-11 07:53:47 (GMT)
commit8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2 (patch)
tree6363b06ab210ef0961fd122be20572a2d5d3754b /Lib/test/test_subprocess.py
parent82fdadeba1ed00941aa2bdb0f8e7dff1c16eb2c3 (diff)
downloadcpython-8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2.zip
cpython-8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2.tar.gz
cpython-8d07c264e4bcaaf1fe3b9fc92ea5730efe13eaa2.tar.bz2
Raise our own SubprocessError rather than a RuntimeError in when dealing with
odd rare errors coming from the subprocess module.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 2d77554..8978b31 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -1179,7 +1179,7 @@ class POSIXProcessTestCase(BaseTestCase):
try:
p = subprocess.Popen([sys.executable, "-c", ""],
preexec_fn=raise_it)
- except RuntimeError as e:
+ except subprocess.SubprocessError as e:
self.assertTrue(
subprocess._posixsubprocess,
"Expected a ValueError from the preexec_fn")
@@ -1544,12 +1544,12 @@ class POSIXProcessTestCase(BaseTestCase):
# Pure Python implementations keeps the message
self.assertIsNone(subprocess._posixsubprocess)
self.assertEqual(str(err), "surrogate:\uDCff")
- except RuntimeError as err:
+ except subprocess.SubprocessError as err:
# _posixsubprocess uses a default message
self.assertIsNotNone(subprocess._posixsubprocess)
self.assertEqual(str(err), "Exception occurred in preexec_fn.")
else:
- self.fail("Expected ValueError or RuntimeError")
+ self.fail("Expected ValueError or subprocess.SubprocessError")
def test_undecodable_env(self):
for key, value in (('test', 'abc\uDCFF'), ('test\uDCFF', '42')):