From: Victor Stinner Date: Fri, 30 Jun 2017 23:01:28 +0000 (+0200) Subject: bpo-30448: Fix support.SuppressCrashReport on macOS (#2515) X-Git-Tag: v2.7.14rc1~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd93f37f0dc537eb7edca7b75e2f92ef54dd2833;p=thirdparty%2FPython%2Fcpython.git bpo-30448: Fix support.SuppressCrashReport on macOS (#2515) Add missing "import subprocess". --- diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index c024b0773c06..ef474e00b68c 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1916,13 +1916,13 @@ class SuppressCrashReport: # # This assumes that this context manager is used in tests # that might trigger the next manager. + import subprocess cmd = ['/usr/bin/defaults', 'read', 'com.apple.CrashReporter', 'DialogType'] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - with proc: - stdout = proc.communicate()[0] + stdout = proc.communicate()[0] if stdout.strip() == b'developer': sys.stdout.write("this test triggers the Crash Reporter, " "that is intentional")