[Numpy-svn] r8332 - trunk/numpy/lib/tests

numpy-svn@scip... numpy-svn@scip...
Tue Apr 13 11:25:36 CDT 2010


Author: charris
Date: 2010-04-13 11:25:36 -0500 (Tue, 13 Apr 2010)
New Revision: 8332

Modified:
   trunk/numpy/lib/tests/test_ufunclike.py
Log:
BUG: Python 2.4 doesn't support "with" statement, use try instead.

Modified: trunk/numpy/lib/tests/test_ufunclike.py
===================================================================
--- trunk/numpy/lib/tests/test_ufunclike.py	2010-04-13 03:26:45 UTC (rev 8331)
+++ trunk/numpy/lib/tests/test_ufunclike.py	2010-04-13 16:25:36 UTC (rev 8332)
@@ -31,13 +31,15 @@
         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]])



More information about the Numpy-svn mailing list