[Numpy-svn] r8371 - in trunk/numpy/lib: . tests

numpy-svn@scip... numpy-svn@scip...
Tue Apr 27 15:54:09 CDT 2010


Author: stefan
Date: 2010-04-27 15:54:08 -0500 (Tue, 27 Apr 2010)
New Revision: 8371

Modified:
   trunk/numpy/lib/tests/test_type_check.py
   trunk/numpy/lib/type_check.py
Log:
BUG: Fix missing import for datatime_data.

Modified: trunk/numpy/lib/tests/test_type_check.py
===================================================================
--- trunk/numpy/lib/tests/test_type_check.py	2010-04-27 16:55:09 UTC (rev 8370)
+++ trunk/numpy/lib/tests/test_type_check.py	2010-04-27 20:54:08 UTC (rev 8371)
@@ -375,5 +375,12 @@
         assert issubdtype(a.dtype,float)
 
 
+class TestDateTimeData:
+
+    def test_basic(self):
+        a = array(['1980-03-23'], dtype=datetime64)
+        assert_equal(datetime_data(a.dtype), ('us', 1, 1, 1))
+
+
 if __name__ == "__main__":
     run_module_suite()

Modified: trunk/numpy/lib/type_check.py
===================================================================
--- trunk/numpy/lib/type_check.py	2010-04-27 16:55:09 UTC (rev 8370)
+++ trunk/numpy/lib/type_check.py	2010-04-27 20:54:08 UTC (rev 8371)
@@ -619,6 +619,7 @@
                     ('den', ctypes.c_int),
                     ('events', ctypes.c_int)]
 
+    import sys
     if sys.version_info[:2] >= (3,1):
         func = ctypes.pythonapi.PyCapsule_GetPointer
         func.argtypes = [ctypes.py_object, ctypes.c_char_p]



More information about the Numpy-svn mailing list