Fix the RLIMIT_CORE resource lowering logic in test_subprocess.

We must only lower the soft limit, since lowering the hard limit makes it impossible to raise it back at the end.
(this could prevent core dumps from being generated when the test suite crashes)
This commit is contained in:
Antoine Pitrou 2013-08-02 00:08:51 +02:00
parent 84f31a5676
commit 284e5ce67e
1 changed files with 1 additions and 1 deletions

View File

@ -1123,7 +1123,7 @@ class _SuppressCoreFiles(object):
if resource is not None:
try:
self.old_limit = resource.getrlimit(resource.RLIMIT_CORE)
resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
resource.setrlimit(resource.RLIMIT_CORE, (0, self.old_limit[1]))
except (ValueError, resource.error):
pass