From e0a7c0db34fe01edbec477ffd32e2dab0a9282cd Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 15 Jun 2009 15:23:18 +0700 Subject: [PATCH] with_timeout.py: ignore a warning --- greentest/with_timeout.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/greentest/with_timeout.py b/greentest/with_timeout.py index 1eef6a9..153c4a4 100755 --- a/greentest/with_timeout.py +++ b/greentest/with_timeout.py @@ -35,6 +35,7 @@ If program.py exited with non-zero value after several runs, return 10 import sys import os import time +import warnings if sys.argv[1:2] and sys.argv[1]=='-t': del sys.argv[1] @@ -51,7 +52,9 @@ except NameError: try: CURRENT_TEST_FILENAME except NameError: + warnings.filterwarnings('ignore', 'tmpnam is a potential security risk to your program') CURRENT_TEST_FILENAME = os.tmpnam() + del warnings.filters[0] class Alarm(Exception): pass