Commit 0c531b34 authored by Stefan Behnel's avatar Stefan Behnel

invalidate type cache in Py2.6+

parent 85e3457d
...@@ -2101,6 +2101,11 @@ class CClassDefNode(StatNode, BlockNode): ...@@ -2101,6 +2101,11 @@ class CClassDefNode(StatNode, BlockNode):
# default values of method arguments. # default values of method arguments.
if self.body: if self.body:
self.body.generate_execution_code(code) self.body.generate_execution_code(code)
# in Py2.6+, we need to invalidate the type cache
code.putln("#if PY_VERSION_HEX >= 0x02060000")
code.putln("(%s)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;" %
self.entry.type.typeptr_cname)
code.putln("#endif")
def annotate(self, code): def annotate(self, code):
if self.body: if self.body:
......
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