Source

MQ for Sage toric varieties / trac_13211_quit_after_workspace.patch

The default branch has multiple heads

Full commit
# HG changeset patch
# Parent 349d3315794177f11f0cdf75778aa4d48c6217a6

Explicitly quit Gap after writing the workspace instead of hoping that the cleaner does its job.

diff --git a/sage/interfaces/gap.py b/sage/interfaces/gap.py
--- a/sage/interfaces/gap.py
+++ b/sage/interfaces/gap.py
@@ -629,11 +629,12 @@
             2
             sage: import sage.tests.interrupt
             sage: try:
-            ...     sage.tests.interrupt.interrupt_after_delay()
-            ...     while True: SymmetricGroup(8).conjugacy_classes_subgroups()
-            ... except KeyboardInterrupt:
-            ...     pass
+            ...       sage.tests.interrupt.interrupt_after_delay()
+            ...       while True: SymmetricGroup(8).conjugacy_classes_subgroups()
+            ... except KeyboardInterrupt, e:
+            ...       print e
             Interrupting Gap...
+            Ctrl-c pressed while running Gap
             sage: gap(2)
             2
         """
@@ -1415,7 +1416,8 @@
     g = Gap(use_workspace_cache=False, max_workspace_size=None)
     for pkg in ['GAPDoc', 'ctbllib', 'sonata', 'guava', 'factint', \
                 'gapdoc', 'grape', 'design', \
-                'toric', 'laguna', 'braid']:   # NOTE: Do *not* autoload hap - it screws up PolynomialRing(Rationals,2)
+                'toric', 'laguna', 'braid']:   
+        # NOTE: Do *not* autoload hap - it screws up PolynomialRing(Rationals,2)
         try:
             g.load_package(pkg, verbose=verbose)
         except RuntimeError, msg:
@@ -1424,6 +1426,7 @@
             pass
     # end for
     g.save_workspace()
+    g.quit()
     
 
 # Check to see if we need to auto-regenerate the gap workspace, i.e.,