<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:jeanmarc.leroux@aerys.in" title="Jean-Marc Le Roux <jeanmarc.leroux@aerys.in>"> <span class="fn">Jean-Marc Le Roux</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - libclang python bindings do not reparse file"
href="https://llvm.org/bugs/show_bug.cgi?id=24471">bug 24471</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - libclang python bindings do not reparse file"
href="https://llvm.org/bugs/show_bug.cgi?id=24471#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - libclang python bindings do not reparse file"
href="https://llvm.org/bugs/show_bug.cgi?id=24471">bug 24471</a>
from <span class="vcard"><a class="email" href="mailto:jeanmarc.leroux@aerys.in" title="Jean-Marc Le Roux <jeanmarc.leroux@aerys.in>"> <span class="fn">Jean-Marc Le Roux</span></a>
</span></b>
<pre>Not a clang bug. It's a python mistake (cf
<a href="http://stackoverflow.com/questions/1132941/least-astonishment-in-python-the-mutable-default-argument">http://stackoverflow.com/questions/1132941/least-astonishment-in-python-the-mutable-default-argument</a>).
Correct code:
def _get_minko_script_classes(self, root):
return self._get_minko_script_classes_rec(root, [])
def _get_minko_script_classes_rec(self, root, cursors):
for cursor in root.get_children():
if cursor.kind == clang.cindex.CursorKind.CLASS_DECL:
for c in cursor.get_children():
if c.kind == clang.cindex.CursorKind.CXX_BASE_SPECIFIER:
if c.displayname == "minko::component::AbstractScript":
cursors.append(cursor)
else:
self._get_minko_script_classes_rec(cursor, cursors)
return cursors</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>