From c4b72a88ef2e6f79bfbab0fc2784eb1c3c366487 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Sun, 10 May 2015 02:08:48 -0700 Subject: [PATCH] sancheck: import resource inside of the posix check This avoids a crash on windows --- src/etc/check-sanitycheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etc/check-sanitycheck.py b/src/etc/check-sanitycheck.py index 0d9c430ec3acd..fc8ed7b383ec5 100644 --- a/src/etc/check-sanitycheck.py +++ b/src/etc/check-sanitycheck.py @@ -13,7 +13,6 @@ import os import sys import functools -import resource STATUS = 0 @@ -37,6 +36,7 @@ def inner(): @only_on(('linux', 'darwin', 'freebsd', 'openbsd')) def check_rlimit_core(): + import resource soft, hard = resource.getrlimit(resource.RLIMIT_CORE) if soft > 0: error_unless_permitted('ALLOW_NONZERO_RLIMIT_CORE', """\