olpcgames SVGSprite bug + fix

Alex Levenson alev742 at gwu.edu
Tue Jul 22 13:31:00 EDT 2008


Hello,

I've been using olpcgames for some physics + puzzle games I'm writing. I
just started using the SVGSprite class but I kept on getting an error when
using it. I realized that in the SVGSprite class a module named 'svg' is
imported, AND a local variable is named svg. So when you call svg.render()
it tries it on the local variable (which is a string) and then that causess
a crash.
The fix is easy, change the line at the top of svgsprite.py from:
from olpcgames import svg
to:
from olpcgames import svg as svgModule
and then later in the code there is one reference to svg that needs to be
changed to svgModule.
Basically just a python scope issue, but I don't know who maintains
olpcgames so I decided to just send this to devel.

Thanks,
Alex Levenson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20080722/35fda38e/attachment.html>


More information about the Devel mailing list