From 7d56e62cff612864b488e8b32a6d88a93cb5abae Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 11 Aug 2010 16:09:19 -0700 Subject: [PATCH] Fix cpp bool test. --- Cython/Compiler/PyrexTypes.py | 10 +++++++--- tests/bugs.txt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index eafe8e36..68437e3d 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -244,7 +244,9 @@ class CTypedefType(BaseType): if self.typedef_is_external: if not self.to_py_utility_code: base_type = self.typedef_base_type - if base_type.is_int: + if type(base_type) is CIntType: + # Various subclasses have special methods + # that should be inherited. self.to_py_utility_code, self.to_py_function = \ self._create_utility_code(c_typedef_int_to_py_function, '__Pyx_PyInt_to_py_%s') @@ -263,7 +265,9 @@ class CTypedefType(BaseType): if self.typedef_is_external: if not self.from_py_utility_code: base_type = self.typedef_base_type - if base_type.is_int: + if type(base_type) is CIntType: + # Various subclasses have special methods + # that should be inherited. self.from_py_utility_code, self.from_py_function = \ self._create_utility_code(c_typedef_int_from_py_function, '__Pyx_PyInt_from_py_%s') @@ -879,7 +883,7 @@ class CBIntType(CIntType): to_py_function = "__Pyx_PyBool_FromLong" from_py_function = "__Pyx_PyObject_IsTrue" - exception_check = 0 + exception_check = 1 # for C++ bool def __repr__(self): return "" diff --git a/tests/bugs.txt b/tests/bugs.txt index cb56af8b..d172b4c6 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -16,7 +16,7 @@ with_statement_module_level_T536 function_as_method_T494 closure_inside_cdef_T554 ipow_crash_T562 -cpp_bool + # CPython regression tests that don't current work: pyregr.test_threadsignals -- 2.26.2