updated for version 7.0158
diff --git a/src/if_python.c b/src/if_python.c
index 623731a..d58f7cf 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -436,6 +436,14 @@
     void
 python_end()
 {
+    static int recurse = 0;
+
+    /* If a crash occurs while doing this, don't try again. */
+    if (recurse != 0)
+	return;
+
+    ++recurse;
+
 #ifdef DYNAMIC_PYTHON
     if (hinstPython && Py_IsInitialized())
     {
@@ -450,6 +458,8 @@
         Py_Finalize();
     }
 #endif
+
+    --recurse;
 }
 
     static int