From: Robert Bradshaw Date: Sat, 16 Aug 2008 11:25:51 +0000 (-0700) Subject: Fix public extensions declared in pxd files. X-Git-Tag: 0.9.8.1~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c0ea3b0fecaff29e0cb5d32c3612e0a46afccf1;p=cython.git Fix public extensions declared in pxd files. --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index d1a418c9..a67dffa5 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2151,15 +2151,6 @@ class CClassDefNode(ClassDefNode): if self.doc and Options.docstrings: scope.doc = embed_position(self.pos, self.doc) - if has_body and not self.in_pxd: - # transforms not yet run on pxd files - from ParseTreeTransforms import AnalyseDeclarationsTransform - transform = AnalyseDeclarationsTransform(None) - for entry in scope.var_entries: - if hasattr(entry, 'needs_property'): - property = transform.create_Property(entry) - self.body.stats.append(property) - if has_body: self.body.analyse_declarations(scope) if self.in_pxd: diff --git a/tests/run/extmember.pyx b/tests/run/extmember.pyx index 86faeed5..c1b958a6 100644 --- a/tests/run/extmember.pyx +++ b/tests/run/extmember.pyx @@ -7,7 +7,21 @@ __doc__ = """ >>> s.e is s True >>> s.e = None + + >>> s = Bot() + >>> s.e = s + >>> s.e = 1 + Traceback (most recent call last): + TypeError: Cannot convert int to extmember.Bot + >>> s.e is s + True + >>> s.e = None """ +# declared in the pxd cdef class Spam: - cdef public Spam e + pass + +# not declared in the pxd +cdef class Bot: + cdef public Bot e