summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2012-11-03 15:26:51 -0700
committerRobert Bradshaw <robertwb@gmail.com>2012-11-03 15:26:51 -0700
commit546fceb704eba7d0d50f4e34cca42699b561fa3a (patch)
tree038141d2b2b964bf3f4c9ed5627c0c0274a4f3f7 /Cython/Compiler/ModuleNode.py
parentc8640d65a01672884d6056d60dcf88468e4f8267 (diff)
parent9df8c9daf10ff30a8e6506b72406d032f268a17b (diff)
downloadcython-546fceb704eba7d0d50f4e34cca42699b561fa3a.tar.gz
Merge branch 'bugs'
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index c3890b656..7f801ab2a 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -1134,7 +1134,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("if (p->__weakref__) PyObject_ClearWeakRefs(o);")
for entry in cpp_class_attrs:
- destructor_name = entry.type.cname.split("::")[-1]
+ split_cname = entry.type.cname.split('::')
+ destructor_name = split_cname.pop()
+ # Make sure the namespace delimiter was not in a template arg.
+ while destructor_name.count('<') != destructor_name.count('>'):
+ destructor_name = split_cname.pop() + '::' + destructor_name
code.putln("p->%s.%s::~%s();" %
(entry.cname, entry.type.declaration_code(""), destructor_name))