@@ -145,7 +145,7 @@ Classes and Methods
145
145
import operator
146
146
import sys
147
147
import warnings
148
- from cysignals.signals cimport sig_on, sig_str, sig_off, sig_error
148
+ from cysignals.signals cimport sig_on, sig_str, sig_off, sig_error, sig_block, sig_unblock
149
149
150
150
import sage.categories.fields
151
151
@@ -284,27 +284,27 @@ cdef int acb_calc_func_callback(acb_ptr out, const acb_t inp, void * param,
284
284
"""
285
285
cdef IntegrationContext ctx
286
286
cdef ComplexBall x
287
- sig_off ()
287
+ sig_block ()
288
288
try :
289
289
ctx = < IntegrationContext> param
290
290
if ctx.exn_type is not None or order >= 2 :
291
291
acb_indeterminate(out)
292
292
return 0
293
- x = ComplexBall.__new__ (ComplexBall)
294
- assert prec == ctx.parent._prec
295
- x._parent = ctx.parent
296
- acb_set(x.value, inp)
297
293
try :
294
+ x = ComplexBall.__new__ (ComplexBall)
295
+ assert prec == ctx.parent._prec
296
+ x._parent = ctx.parent
297
+ acb_set(x.value, inp)
298
298
y = ctx.f(x, (order == 1 ))
299
299
if not isinstance (y, ComplexBall):
300
300
y = ctx.parent.coerce(y)
301
301
acb_set(out, (< ComplexBall> y).value)
302
- except Exception :
302
+ except BaseException :
303
303
ctx.exn_type, ctx.exn_obj, ctx.exn_tb = sys.exc_info()
304
304
acb_indeterminate(out)
305
305
return 0
306
306
finally :
307
- sig_on ()
307
+ sig_unblock ()
308
308
309
309
310
310
class ComplexBallField (UniqueRepresentation , sage.rings.abc.ComplexBallField ):
@@ -1175,6 +1175,14 @@ class ComplexBallField(UniqueRepresentation, sage.rings.abc.ComplexBallField):
1175
1175
1176
1176
sage: ComplexBallField( 100) . integral( lambda x, _: sin( x) , RBF( 0) , RBF( 1))
1177
1177
[0.4596976941318602825990633926 +/- ...e-29 ]
1178
+
1179
+ sage: from cysignals. alarm import alarm
1180
+ sage: alarm( 0. 1r)
1181
+ sage: C = ComplexBallField( 1000000)
1182
+ sage: C. integral( lambda x, _: x. cos( ) * x. sin( ) , 0, 1)
1183
+ Traceback ( most recent call last) :
1184
+ ...
1185
+ AlarmInterrupt
1178
1186
"""
1179
1187
cdef IntegrationContext ctx = IntegrationContext()
1180
1188
cdef acb_calc_integrate_opt_t arb_opts
0 commit comments