Skip to content

Commit

Permalink
BUG: Fix missing import for datatime_data.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Apr 27, 2010
1 parent 1e659b5 commit 4132207
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions numpy/lib/tests/test_type_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,5 +375,12 @@ def test_asfarray(self):
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()
1 change: 1 addition & 0 deletions numpy/lib/type_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ class DATETIMEMETA(ctypes.Structure):
('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]
Expand Down

0 comments on commit 4132207

Please sign in to comment.