]> granicus.if.org Git - python/commitdiff
Fix the RLIMIT_CORE resource lowering logic in test_subprocess.
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 1 Aug 2013 22:08:51 +0000 (00:08 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 1 Aug 2013 22:08:51 +0000 (00:08 +0200)
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)

Lib/test/test_subprocess.py

index 7899aebe06268da158f28c4ad5a69d6bd80b86ed..3bbb19c573fa4306ba8c43c89d5fa463e558425d 100644 (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