- Fixed PyMac_DoYield:
  - Update lastyield correctly
  - Do event handling if PyMac_YieldEnabled > 0 (previous cmd-. fix
    broke this)
- Use our own GUSISpin routine: fixes crash when exiting with sockets
  open and keeps windows, etc reacting consistently when waiting for
  accepts(), etc.
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c
index 7241539..019e0be 100644
--- a/Mac/Python/macmain.c
+++ b/Mac/Python/macmain.c
@@ -28,6 +28,7 @@
 #include "pythonresources.h"
 #include "import.h"
 #include "marshal.h"
+#include "macglue.h"
 
 #include <Memory.h>
 #include <Resources.h>
@@ -108,6 +109,7 @@
 #if defined(USE_GUSI)
 	/* Setup GUSI */
 	GUSIDefaultSetup();
+	PyMac_SetGUSISpin();
 #endif
 
 #ifdef USE_SIOUX
@@ -396,7 +398,14 @@
 	}
 	else
 		SIOUXSettings.autocloseonquit = 1;
-#endif
+#ifdef USE_GUSI
+	/*
+	** Workaround for Sioux/GUSI combo: we should not call
+	** SiouxHandleOneEvent after the window is closed
+	*/
+	PyMac_ConsoleIsDead = 1;
+#endif /* USE_GUSI */
+#endif /* USE_SIOUX */
 #ifdef THINK_C
 	console_options.pause_atexit = keep;
 #endif