def prevent_core_dump():
 core_resource = resource.RLIMIT_CORE
 try:
  core_limit_prev = resource.getrlimit(core_resource)
 except ValueError as exc:
  error = DaemonOSEnvironmentError(('System does not support RLIMIT_CORE resource limit (%(exc)s)' % vars()))
  raise error
 core_limit = (0, 0)
 resource.setrlimit(core_resource, core_limit)

def prevent_core_dump ( ) : core_resource = resource . RLIMIT_CORE try : core_limit_prev = resource . getrlimit ( core_resource ) except ValueError as exc : error = DaemonOSEnvironmentError ( ( 'System does not support RLIMIT_CORE resource limit (%(exc)s)' % vars ( ) ) ) raise error core_limit = ( 0 , 0 ) resource . setrlimit ( core_resource , core_limit )
prevent this process from generating a core dump .