diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2015-09-06 21:44:45 +0300 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2015-09-06 21:44:45 +0300 |
commit | f352202977fc53197bd38198b1ac26ed4008a9ba (patch) | |
tree | 34246df426e6f7d82794886be98c613903a5655e /Lib/test/tf_inherit_check.py | |
parent | d68070857ae58758849446f5ae162ff3bffb7d6e (diff) | |
parent | 2936930f6c8fc1d8992b680181c30f417d74b7c2 (diff) | |
download | cpython-f352202977fc53197bd38198b1ac26ed4008a9ba.tar.gz |
#23144: merge with 3.4.
Diffstat (limited to 'Lib/test/tf_inherit_check.py')
-rw-r--r-- | Lib/test/tf_inherit_check.py | 32 |
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) |