I am running code in a loop and certain function might take
long or short time. I don't want to wait long and
want to continue with the fast cases.

Up to sage 5.12 I used:

        alarm(5)
        try:
                F=mightbelong(n)
                alarm(0) #to not fire later
        except KeyboardInterrupt: #alarm
                alarm(0)
                continue
        #alarm free code

On 5.13 alarm(0) fails.

If I do 
alarm(0.1);fa=factor(2)
I get KeyboardInterrupt which breaks later code
though the critical stuff passed.

How to cancel a pending alarm()?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to