Fix e_nogilcmeth
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 11 Jun 2008 22:12:23 +0000 (15:12 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 11 Jun 2008 22:12:23 +0000 (15:12 -0700)
Cython/Compiler/PyrexTypes.py
tests/errors/e_nogilcmeth.pxd [new file with mode: 0644]
tests/errors/e_nogilcmeth.pyx

index 092d2536ce45e0aba1291681c014e63da987c4d6..a8ff7980e3ad4eef5ad5732858372f7a344deaab 100644 (file)
@@ -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 (file)
index 0000000..08b821c
--- /dev/null
@@ -0,0 +1,2 @@
+cdef class C:
+       cdef void f(self)
index 2efdbcca8e41299ea01eb8e6e128aea54a42a66e..6cd962175ca1c8dc4bb34faeea3cc224f00e1134 100644 (file)
@@ -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
 """