Can't use inspect.stack() with python2.6 or 2.7

This confuses me. Anyone know what this means/how to fix it? I get the same error with python2.6, but python2.5 works fine.

Panda 1.8, on OSX 10.6.8

My project uses class decorators, which are not in python2.5, so I can’t just use it. Python2.6 is about 4 years old now, so its not like I’m trying to use way too new unsupported things here.

I think you need to compile your own build of Panda against Python 2.7 for that to work. The one for download is probably compiled against Python 2.5 which is why that works.
Does other stuff work, other than inspect.stack()?

Everything else works. This is the first issue I have had, and I’ve been using 2.6 or 2.7 ever since I started using panda I think.

It’s probably what teedee said. “import panda3d.core” doesn’t actually load the Panda libraries yet, you need to actually import something from the module (like “from panda3d.core import *”) for it to load, then you’ll probably see that you can’t run that in any other Python version than the supported one.

Every one of my panda projects runs completely fine with python2.7. I only fell back to 2.5 when I got this error. I honestly can’t think of a time that I have use python 2.5 with panda other than this one test.

And if import panda3d.core does not really do anything, how does it make inspect.stack() crash?

I don’t even have to import panda3d.core. Just “import panda3d” is enough to break inspect.stack.

Is it just an amazing accident that every single python feature I have used (including cython linking against python) just worked with 2.7 and 2.6? The runtime uses newer than python 2.5 now right? Is there a newer SDK yet?

Btw, this code used to work, probably with panda 1.7.2 and python2.6. I just flipped on my debug flag yesterday (which uses inspect.stack()), and crash!

ppython seems to be python 2.7.3 on my linux box (running some random daily build), so I can run my debug builds that need inspect.stack() on there, and get what I need, so this isn’t really causing my much trouble, but it is pretty strange.