def _suppress_core_files(self):
            """Try to prevent core files from being created.
            Returns previous ulimit if successful, else None.
            """
            try:
                import resource
                old_limit = resource.getrlimit(resource.RLIMIT_CORE)
                resource.setrlimit(resource.RLIMIT_CORE, (0,0))
                return old_limit
            except (__HOLE__, ValueError, resource.error):
                return None
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/test_subprocess.py/ProcessTestCase._suppress_core_files