Commit 7c0ea3b0 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix public extensions declared in pxd files.

parent d75b726f
......@@ -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:
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment