diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index c024b0773c0686..ef474e00b68cc3 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1916,13 +1916,13 @@ def __enter__(self): # # 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")