Unexpected python exception

Richard Purdie rpurdie at rpsys.net
Wed Nov 11 15:29:21 CET 2009

On Wed, 2009-11-11 at 05:04 -0800, Chris Rebert wrote:
> On Wed, Nov 11, 2009 at 4:37 AM, Richard Purdie <rpurdie at rpsys.net> wrote:
> <snip>
> > Is there a way to make the "global x" apply to all functions without
> > adding it to each one?
> Thankfully, no.

Hmm :(.

> > What I'm trying to do is to avoid having "import X" statements
> > everywhere by changing __builtin__. It seems my approach doesn't have
> > quite the same effect as a true import though.
> And you can't just put all your imports together at the top of the
> file because...?

The application in question is bitbake, the parsing tool for the
OpenEmbedded and Poky projects.

We're talking about python code fragments spread across about 8,000
files which make up the "metadata" some of which is public and some of
which is not. Rightly or wrongly bitbake does some interesting things
with its execution contexts for these code fragments.

Lets just say its not a traditional use case, we know the way bitbake
does some things is evil but it does other things rather well and we
can't break those.



More information about the Python-list mailing list