Does your server restart or does your Python kernel just crash?
In the latter case, could you try to get the stack trace via:
 gdb --args python my_script.py
...
Reading symbols from python...done.
(gdb) run
...
(gdb) backtrace
...