summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-07-23 10:35:20 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-07-23 10:35:20 (GMT)
commitd7eb3a8d734f9e5269f3a9bc4d53d967fa1908bb (patch)
tree1357c40a3e3d560ffe2265bc9d81568c7acd2b2f /Lib/test/test_subprocess.py
parent284beddb21552ae8ecfc10f4503a83852ded1dbd (diff)
downloadcpython-d7eb3a8d734f9e5269f3a9bc4d53d967fa1908bb.zip
cpython-d7eb3a8d734f9e5269f3a9bc4d53d967fa1908bb.tar.gz
cpython-d7eb3a8d734f9e5269f3a9bc4d53d967fa1908bb.tar.bz2
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. ........
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index a27ef63..5cdbe2d 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -568,6 +568,21 @@ 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", end='')
+ sys.stdout.flush()
+
try:
import resource
old_limit = resource.getrlimit(resource.RLIMIT_CORE)
@@ -576,6 +591,8 @@ class ProcessTestCase(unittest.TestCase):
except (ImportError, ValueError, resource.error):
return None
+
+
def _unsuppress_core_files(self, old_limit):
"""Return core file behavior to default."""
if old_limit is None: