cython

changeset 3650:15eaaaa72cfe

Fix cpp bool test.
author Robert Bradshaw <robertwb@math.washington.edu>
date Wed Aug 11 16:09:19 2010 -0700 (21 months ago)
parents 79342bf0a31d
children b0ec38a81a35afad019f1983
files Cython/Compiler/PyrexTypes.py tests/bugs.txt
line diff
1.1 --- a/Cython/Compiler/PyrexTypes.py Wed Aug 11 12:53:25 2010 -0700 1.2 +++ b/Cython/Compiler/PyrexTypes.py Wed Aug 11 16:09:19 2010 -0700 1.3 @@ -244,7 +244,9 @@ 1.4 if self.typedef_is_external: 1.5 if not self.to_py_utility_code: 1.6 base_type = self.typedef_base_type 1.7 - if base_type.is_int: 1.8 + if type(base_type) is CIntType: 1.9 + # Various subclasses have special methods 1.10 + # that should be inherited. 1.11 self.to_py_utility_code, self.to_py_function = \ 1.12 self._create_utility_code(c_typedef_int_to_py_function, 1.13 '__Pyx_PyInt_to_py_%s') 1.14 @@ -263,7 +265,9 @@ 1.15 if self.typedef_is_external: 1.16 if not self.from_py_utility_code: 1.17 base_type = self.typedef_base_type 1.18 - if base_type.is_int: 1.19 + if type(base_type) is CIntType: 1.20 + # Various subclasses have special methods 1.21 + # that should be inherited. 1.22 self.from_py_utility_code, self.from_py_function = \ 1.23 self._create_utility_code(c_typedef_int_from_py_function, 1.24 '__Pyx_PyInt_from_py_%s') 1.25 @@ -879,7 +883,7 @@ 1.26 1.27 to_py_function = "__Pyx_PyBool_FromLong" 1.28 from_py_function = "__Pyx_PyObject_IsTrue" 1.29 - exception_check = 0 1.30 + exception_check = 1 # for C++ bool 1.31 1.32 def __repr__(self): 1.33 return "<CNumericType bint>"
2.1 --- a/tests/bugs.txt Wed Aug 11 12:53:25 2010 -0700 2.2 +++ b/tests/bugs.txt Wed Aug 11 16:09:19 2010 -0700 2.3 @@ -16,7 +16,7 @@ 2.4 function_as_method_T494 2.5 closure_inside_cdef_T554 2.6 ipow_crash_T562 2.7 -cpp_bool 2.8 + 2.9 2.10 # CPython regression tests that don't current work: 2.11 pyregr.test_threadsignals