summaryrefslogtreecommitdiff
path: root/Lib/test/tf_inherit_check.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/tf_inherit_check.py')
-rw-r--r--Lib/test/tf_inherit_check.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/Lib/test/tf_inherit_check.py b/Lib/test/tf_inherit_check.py
index afe50d2325..138f25a858 100644
--- a/Lib/test/tf_inherit_check.py
+++ b/Lib/test/tf_inherit_check.py
@@ -4,22 +4,24 @@
import sys
import os
+from test.support import SuppressCrashReport
-verbose = (sys.argv[1] == 'v')
-try:
- fd = int(sys.argv[2])
-
+with SuppressCrashReport():
+ verbose = (sys.argv[1] == 'v')
try:
- os.write(fd, b"blat")
- except OSError:
- # Success -- could not write to fd.
- sys.exit(0)
- else:
+ fd = int(sys.argv[2])
+
+ try:
+ os.write(fd, b"blat")
+ except OSError:
+ # Success -- could not write to fd.
+ sys.exit(0)
+ else:
+ if verbose:
+ sys.stderr.write("fd %d is open in child" % fd)
+ sys.exit(1)
+
+ except Exception:
if verbose:
- sys.stderr.write("fd %d is open in child" % fd)
+ raise
sys.exit(1)
-
-except Exception:
- if verbose:
- raise
- sys.exit(1)