make pyembed more resilient