Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi Caolán, *,

On Mon, Mar 7, 2011 at 12:23 PM, Caolán McNamara <caolanm@redhat.com> wrote:
On Thu, 2011-03-03 at 01:07 +0100, Christian Lohmaier wrote:
Yes, I wonder why it fails here :-(

Gagh, that's frustrating. Can you stick a try: except: block around it

Thanks for pushing me into the correct direction with this!

It's a stupid thing really, the
"found g_exportedScripts Tuple([Name('capitalisePython')])"

is key here - it is "Tuple(.....)" whereas default, builtin type tuple
wouldn't print that. (someone more experienced with python probably
would have spot that right away)

So the expr is not a real tuple, and thus the iteration fails because
python 2.3 doesn't do any implicit conversion, the try - except
revealed a TypeError - iteration over non-sequence

So looking again at the compiler-module's documentation:
http://docs.python.org/release/2.3.5/lib/module-compiler.ast.html

The "Tuple" is a Node-type, that in turn contains a nodes attribute,
iterating over those nodes works, so the fix is:

- for item in node.expr:
+ for item in node.expr.nodes:

ciao
Christian

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.