The answer is very obvious: the OverflowError is raised *inside* the sig_on/sig_off block.

The general solution would be

sig_on()
try:
    mpz_bin_ui(x.value, aa.value, b)
finally:
    sig_off()

but in this case you can simply move the conversion:

cdef unsigned long b0 = b    # <-- OverflowError possible here
sig_on()
mpz_bin_ui(x.value, aa.value, b0)   # <-- No more OverflowError
sig_off()

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to