Hi,
Lisandro Dalcin wrote:
> FYI, in Py2.6 my mpi4py code still does not work (but works in Py3!).
> And the problem still is the method cache.
Then what about this patch? (based on what you proposed in an earlier post)
Still crashes for me on Py3, but it might work around the problem you
experience.
Stefan
# HG changeset patch
# User Stefan Behnel <[EMAIL PROTECTED]>
# Date 1211618008 -7200
# Node ID ac0cc8edbf55197cb7046447d59d0f8ba80c9b92
# Parent 867034806ace7bb715c9c4d5509b12075c73e270
invalidate type cache in Py2.6+
diff -r 867034806ace -r ac0cc8edbf55 Cython/Compiler/Nodes.py
--- a/Cython/Compiler/Nodes.py Fri May 23 22:32:33 2008 +0200
+++ b/Cython/Compiler/Nodes.py Sat May 24 10:33:28 2008 +0200
@@ -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:
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev