Skip to content

Commit fd93f37

Browse files
authored
bpo-30448: Fix support.SuppressCrashReport on macOS (#2515)
Add missing "import subprocess".
1 parent 311ae46 commit fd93f37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/support/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,13 +1916,13 @@ def __enter__(self):
19161916
#
19171917
# This assumes that this context manager is used in tests
19181918
# that might trigger the next manager.
1919+
import subprocess
19191920
cmd = ['/usr/bin/defaults', 'read',
19201921
'com.apple.CrashReporter', 'DialogType']
19211922
proc = subprocess.Popen(cmd,
19221923
stdout=subprocess.PIPE,
19231924
stderr=subprocess.PIPE)
1924-
with proc:
1925-
stdout = proc.communicate()[0]
1925+
stdout = proc.communicate()[0]
19261926
if stdout.strip() == b'developer':
19271927
sys.stdout.write("this test triggers the Crash Reporter, "
19281928
"that is intentional")

0 commit comments

Comments
 (0)