From: Stefan Behnel Date: Thu, 5 Jun 2008 13:03:19 +0000 (+0200) Subject: allow diverging nogil declaration, but only when assigning a nogil function to a... X-Git-Tag: 0.9.8rc1~11^2~10^2~6^2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e6254033cda7eb5ac22b1239510b5a88909fb4cd;p=cython.git allow diverging nogil declaration, but only when assigning a nogil function to a gil pointer --- diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index a9183fc7..45346675 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -695,7 +695,7 @@ class CFuncType(CType): return 0 if not self.same_calling_convention_as(other_type): return 0 - if self.nogil != other_type.nogil: + if self.nogil and not other_type.nogil: return 0 return 1 diff --git a/tests/errors/nogilfunctype.pyx b/tests/errors/nogilfunctype.pyx index 617ed829..9b5580f0 100644 --- a/tests/errors/nogilfunctype.pyx +++ b/tests/errors/nogilfunctype.pyx @@ -1,9 +1,14 @@ cdef extern from *: - cdef void f() nogil - cdef void (*fp)() + cdef void f() + cdef void (*fp)() nogil + + cdef void g() nogil + cdef void (*gp)() + +gp = g fp = f _ERRORS = u""" -5:6: Cannot assign type 'void (void) nogil' to 'void (*)(void)' +10:6: Cannot assign type 'void (void)' to 'void (*)(void) nogil' """