From 514a01f6fe494456c09b9e66d910ee514e6aa9d1 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 13 Apr 2010 16:25:36 +0000 Subject: BUG: Python 2.4 doesn't support "with" statement, use try instead. --- numpy/lib/tests/test_ufunclike.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numpy/lib/tests') diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py index e07b495eb..f2712612e 100644 --- a/numpy/lib/tests/test_ufunclike.py +++ b/numpy/lib/tests/test_ufunclike.py @@ -31,13 +31,15 @@ class TestUfunclike(TestCase): a = nx.array([4.5, 2.3, 6.5]) out = nx.zeros(a.shape, float) tgt = nx.array([2.169925, 1.20163386, 2.70043972]) - with warnings.catch_warnings(): + try: warnings.filterwarnings("ignore",category=DeprecationWarning) res = ufl.log2(a) assert_almost_equal(res, tgt) res = ufl.log2(a, out) assert_almost_equal(res, tgt) assert_almost_equal(out, tgt) + except DeprecationWarning: + pass def test_fix(self): a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]]) -- cgit v1.2.1