diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-07-23 09:50:05 (GMT) |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2010-07-23 09:50:05 (GMT) |
commit | 102d11a6d6f972c5d9071f0c9a13204040ec39c8 (patch) | |
tree | 303813c0ee535bc41d206128f543089357fd2e8a /Lib | |
parent | e8d252dbcbafc0113c0b9bf6b13a72af5f0ee848 (diff) | |
download | cpython-102d11a6d6f972c5d9071f0c9a13204040ec39c8.zip cpython-102d11a6d6f972c5d9071f0c9a13204040ec39c8.tar.gz cpython-102d11a6d6f972c5d9071f0c9a13204040ec39c8.tar.bz2 |
Workaround for issue 4047: in some configurations of
the Crash Reporter on OSX test_subprocess will trigger
the reporter.
This patch prints a warning when the Crash Reporter will
get triggered intentionally, which should avoid confusing
people.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_subprocess.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 0f7d26c..e6ba8cb 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -559,6 +559,21 @@ class _SuppressCoreFiles(object): except (ImportError, ValueError, resource.error): pass + if sys.platform == 'darwin': + # Check if the 'Crash Reporter' on OSX was configured + # in 'Developer' mode and warn that it will get triggered + # when it is. + # + # This assumes that this context manager is used in tests + # that might trigger the next manager. + value = subprocess.Popen(['/usr/bin/defaults', 'read', + 'com.apple.CrashReporter', 'DialogType'], + stdout=subprocess.PIPE).communicate()[0] + if value.strip() == b'developer': + print("this tests triggers the Crash Reporter, " + "that is intentional", end='') + sys.stdout.flush() + def __exit__(self, *args): """Return core file behavior to default.""" if self.old_limit is None: |