[Numpy-svn] r6339 - in trunk/numpy: lib/tests ma

numpy-svn@scip... numpy-svn@scip...
Wed Feb 4 14:52:40 CST 2009


Author: pierregm
Date: 2009-02-04 14:52:36 -0600 (Wed, 04 Feb 2009)
New Revision: 6339

Modified:
   trunk/numpy/lib/tests/test__iotools.py
   trunk/numpy/ma/core.py
Log:
* test__iotools : prevent test_upgrademapper if dateutil is not installed
* MaskedArray.__rmul__ : switch to multiply(self, other)

Modified: trunk/numpy/lib/tests/test__iotools.py
===================================================================
--- trunk/numpy/lib/tests/test__iotools.py	2009-02-03 17:11:44 UTC (rev 6338)
+++ trunk/numpy/lib/tests/test__iotools.py	2009-02-04 20:52:36 UTC (rev 6339)
@@ -130,11 +130,14 @@
     #
     def test_upgrademapper(self):
         "Tests updatemapper"
-        import dateutil.parser
-        import datetime
-        dateparser = dateutil.parser.parse
-        StringConverter.upgrade_mapper(dateparser, datetime.date(2000,1,1))
-        convert = StringConverter(dateparser, datetime.date(2000, 1, 1))
-        test = convert('2001-01-01')
-        assert_equal(test, datetime.datetime(2001, 01, 01, 00, 00, 00))
+        try:
+            import dateutil.parser
+            import datetime
+            dateparser = dateutil.parser.parse
+            StringConverter.upgrade_mapper(dateparser, datetime.date(2000,1,1))
+            convert = StringConverter(dateparser, datetime.date(2000, 1, 1))
+            test = convert('2001-01-01')
+            assert_equal(test, datetime.datetime(2001, 01, 01, 00, 00, 00))
+        except ImportError:
+            pass
 

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2009-02-03 17:11:44 UTC (rev 6338)
+++ trunk/numpy/ma/core.py	2009-02-04 20:52:36 UTC (rev 6339)
@@ -2466,7 +2466,7 @@
     #
     def __rmul__(self, other):
         "Multiply other by self, and return a new masked array."
-        return multiply(other, self)
+        return multiply(self, other)
     #
     def __div__(self, other):
         "Divide other into self, and return a new masked array."



More information about the Numpy-svn mailing list