diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-09-07 06:36:54 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-09-07 06:36:54 +0000 |
commit | 2b6af2c5e95497ba9f7ea23eb9aef9f3bfc22aa2 (patch) | |
tree | 2217d8ce5bae1b2f044528c8932e5176aeb8ee93 /numpy/core/_internal.py | |
parent | c4b98bdd9b0046494c1f972912137b4a7e5c6874 (diff) | |
download | numpy-2b6af2c5e95497ba9f7ea23eb9aef9f3bfc22aa2.tar.gz |
Add c_intp to ctypeslib. Add converttree to alter_code functions. Fix ctypeslib when ctypes is not available.
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r-- | numpy/core/_internal.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py index e650be9a0..ff816faf5 100644 --- a/numpy/core/_internal.py +++ b/numpy/core/_internal.py @@ -192,10 +192,11 @@ def _commastring(astr): return result def _getintp_ctype(): - if _getintp_ctype.cache: - return _getintp_ctype.cache - import ctypes + val = _getintp_ctype.cache + if val is not None: + return val char = dtype('p').char + import ctypes if (char == 'i'): val = ctypes.c_int elif char == 'l': @@ -203,7 +204,7 @@ def _getintp_ctype(): elif char == 'q': val = ctypes.c_longlong else: - raise ValueError, "confused about intp->ctypes." + val = ctypes.c_long _getintp_ctype.cache = val return val _getintp_ctype.cache = None |