summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-07-23 12:32:07 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-07-23 12:32:07 (GMT)
commitef8204e7133fcffe730c60ca4ec1c321156ea797 (patch)
treeffc9ab3222d568b15c64b59e3a6854081c5acfb6
parentea435512eaa8dd3f2a1e1c30e874486d2073038c (diff)
downloadcpython-ef8204e7133fcffe730c60ca4ec1c321156ea797.zip
cpython-ef8204e7133fcffe730c60ca4ec1c321156ea797.tar.gz
cpython-ef8204e7133fcffe730c60ca4ec1c321156ea797.tar.bz2
Merged revisions 83079 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r83079 | ronald.oussoren | 2010-07-23 13:26:30 +0100 (Fri, 23 Jul 2010) | 15 lines Merged revisions 83067 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83067 | ronald.oussoren | 2010-07-23 10:50:05 +0100 (Fri, 23 Jul 2010) | 8 lines 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. ........ ................
-rw-r--r--Lib/test/test_subprocess.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index e8f39b1..87af4ad 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -521,6 +521,20 @@ class ProcessTestCase(unittest.TestCase):
"""Try to prevent core files from being created.
Returns previous ulimit if successful, else None.
"""
+ 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"
+ sys.stdout.flush()
+
try:
import resource
old_limit = resource.getrlimit(resource.RLIMIT_CORE)