projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85e3457
)
invalidate type cache in Py2.6+
author
Stefan Behnel
<scoder@users.berlios.de>
Sat, 24 May 2008 08:33:28 +0000
(10:33 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sat, 24 May 2008 08:33:28 +0000
(10:33 +0200)
Cython/Compiler/Nodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Nodes.py
b/Cython/Compiler/Nodes.py
index db1370a061802d5eb5337229c6ceac7abd602837..89e874375a0de49151d05c83243c4a3659359c7d 100644
(file)
--- a/
Cython/Compiler/Nodes.py
+++ b/
Cython/Compiler/Nodes.py
@@
-2101,6
+2101,11
@@
class CClassDefNode(StatNode, BlockNode):
# default values of method arguments.
if self.body:
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):
if self.body: