In what way is it crashing? Does it generate a python stack trace, or a hard C++ crash? Maybe there’s some version incompatibility with the particular wx libs you are using?
I don’t see anything obviously wrong in your loop. Note that nowadays, Panda comes with its own wx loop built-in, which you can activate by calling base.startWx(). But this loop does the same thing that yours does.