diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2010-05-04 06:24:07 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2010-05-04 06:24:07 +0000 |
commit | e014ff75420eeb809699935433ab4c61bd7f6f8b (patch) | |
tree | a125e6bdf9a6f200af69b44a696d090d509eb59f /numpy/lib | |
parent | adad97ce2057b59be2a3a2760df3e1190fefa160 (diff) | |
download | numpy-e014ff75420eeb809699935433ab4c61bd7f6f8b.tar.gz |
BUG: Fix datetime_data for python versions >= 2.7.
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/type_check.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py index ecc575e89..5db65a3c5 100644 --- a/numpy/lib/type_check.py +++ b/numpy/lib/type_check.py @@ -638,7 +638,10 @@ def datetime_data(dtype): # FIXME: This needs to be kept consistent with enum in ndarrayobject.h from numpy.core.multiarray import DATETIMEUNITS obj = ctypes.py_object(DATETIMEUNITS) - result = func(obj) + if sys.version_info[:2] >= (2,7): + result = func(obj, ctypes.c_char_p(None)) + else: + result = func(obj) _unitnum2name = ctypes.cast(ctypes.c_void_p(result), ctypes.POINTER(ctypes.c_char_p)) return (_unitnum2name[base], struct.num, struct.den, struct.events) |