diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2010-04-13 16:25:36 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2010-04-13 16:25:36 +0000 |
commit | 514a01f6fe494456c09b9e66d910ee514e6aa9d1 (patch) | |
tree | a4b766c83f47b2db9618896bb26cee530d8e4716 | |
parent | 0351ce05794bb62d99ca205b69eeca5f71ad2b6a (diff) | |
download | numpy-514a01f6fe494456c09b9e66d910ee514e6aa9d1.tar.gz |
BUG: Python 2.4 doesn't support "with" statement, use try instead.
-rw-r--r-- | numpy/lib/tests/test_ufunclike.py | 4 |
1 files changed, 3 insertions, 1 deletions
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]]) |