From 6f457b91753e2b2edd78ddccac73bed1bc0102a9 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw <robertwb@math.washington.edu> Date: Wed, 11 Jun 2008 15:12:23 -0700 Subject: [PATCH] Fix e_nogilcmeth --- Cython/Compiler/PyrexTypes.py | 4 ++++ tests/errors/e_nogilcmeth.pxd | 2 ++ tests/errors/e_nogilcmeth.pyx | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/errors/e_nogilcmeth.pxd diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 092d2536..a8ff7980 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -699,6 +699,8 @@ class CFuncType(CType): return 0 if not self.same_calling_convention_as(other_type): return 0 + if self.nogil != other_type.nogil: + return 0 return 1 def compatible_signature_with(self, other_type, as_cmethod = 0): @@ -731,6 +733,8 @@ class CFuncType(CType): return 0 if not self.same_calling_convention_as(other_type): return 0 + if self.nogil != other_type.nogil: + return 0 self.original_sig = other_type.original_sig or other_type if as_cmethod: self.args[0] = other_type.args[0] diff --git a/tests/errors/e_nogilcmeth.pxd b/tests/errors/e_nogilcmeth.pxd new file mode 100644 index 00000000..08b821c9 --- /dev/null +++ b/tests/errors/e_nogilcmeth.pxd @@ -0,0 +1,2 @@ +cdef class C: + cdef void f(self) diff --git a/tests/errors/e_nogilcmeth.pyx b/tests/errors/e_nogilcmeth.pyx index 2efdbcca..6cd96217 100644 --- a/tests/errors/e_nogilcmeth.pyx +++ b/tests/errors/e_nogilcmeth.pyx @@ -1,8 +1,8 @@ cdef class C: - cdef void f(self): + cdef void f(self) nogil: pass _ERRORS = u""" -/Local/Projects/D/Pyrex/Source/Tests/Errors3/e_nogilcmeth.pyx:2:6: Signature does not match previous declaration +/Local/Projects/D/Pyrex/Source/Tests/Errors3/e_nogilcmeth.pyx:2:6: Signature not compatible with previous declaration /Local/Projects/D/Pyrex/Source/Tests/Errors3/e_nogilcmeth.pxd:2:12: Previous declaration is here """ -- 2.26.2