Skip to content

Commit 3b57dd3

Browse files
committed
Roll back the changes of element.pyx
1 parent 4bdb117 commit 3b57dd3

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

src/sage/libs/gap/element.pyx

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ cdef class GapElement(RingElement):
984984
GAPError: Error, no method found!
985985
Error, no 1st choice method found for `+' on 2 arguments
986986
"""
987-
cdef volatile Obj result
987+
cdef Obj result
988988
try:
989989
sig_GAP_Enter()
990990
sig_on()
@@ -1012,7 +1012,7 @@ cdef class GapElement(RingElement):
10121012
...
10131013
GAPError: Error, no method found! ...
10141014
"""
1015-
cdef volatile Obj result
1015+
cdef Obj result
10161016
try:
10171017
sig_GAP_Enter()
10181018
sig_on()
@@ -1041,7 +1041,7 @@ cdef class GapElement(RingElement):
10411041
GAPError: Error, no method found!
10421042
Error, no 1st choice method found for `*' on 2 arguments
10431043
"""
1044-
cdef volatile Obj result
1044+
cdef Obj result
10451045
try:
10461046
sig_GAP_Enter()
10471047
sig_on()
@@ -1075,7 +1075,7 @@ cdef class GapElement(RingElement):
10751075
...
10761076
GAPError: Error, Rational operations: <divisor> must not be zero
10771077
"""
1078-
cdef volatile Obj result
1078+
cdef Obj result
10791079
try:
10801080
sig_GAP_Enter()
10811081
sig_on()
@@ -1102,7 +1102,7 @@ cdef class GapElement(RingElement):
11021102
GAPError: Error, no method found!
11031103
Error, no 1st choice method found for `mod' on 2 arguments
11041104
"""
1105-
cdef volatile Obj result
1105+
cdef Obj result
11061106
try:
11071107
sig_GAP_Enter()
11081108
sig_on()
@@ -1150,7 +1150,6 @@ cdef class GapElement(RingElement):
11501150
GAPError: Error, no method found! Error, no 1st choice
11511151
method found for `InverseMutable' on 1 arguments
11521152
"""
1153-
cdef volatile Obj result
11541153
try:
11551154
sig_GAP_Enter()
11561155
sig_on()
@@ -2481,10 +2480,6 @@ cdef class GapElement_Function(GapElement):
24812480
GAPError: Error, no method found!
24822481
Error, no 1st choice method found for `SumOp' on 2 arguments
24832482
2484-
sage: rnd=[1,2,3]
2485-
sage: libgap.Sum(rnd)
2486-
6
2487-
24882483
sage: for i in range(100):
24892484
....: rnd = [ randint(-10,10) for i in range(randint(0,7)) ]
24902485
....: # compute the sum in GAP
@@ -2500,20 +2495,18 @@ cdef class GapElement_Function(GapElement):
25002495
sage: libgap_exec('echo hello from the shell')
25012496
hello from the shell
25022497
"""
2503-
cdef volatile Obj result = NULL
2504-
cdef volatile Obj arg_list
2498+
cdef Obj result = NULL
2499+
cdef Obj arg_list
25052500
cdef int n = len(args)
25062501
cdef volatile Obj v2
25072502

25082503
if n > 0 and n <= 3:
25092504
libgap = self.parent()
25102505
a = [x if isinstance(x, GapElement) else libgap(x) for x in args]
25112506

2512-
cdef bint sig_on_called = False
25132507
try:
25142508
sig_GAP_Enter()
25152509
sig_on()
2516-
sig_on_called = True
25172510
if n == 0:
25182511
result = GAP_CallFunc0Args(self.value)
25192512
elif n == 1:
@@ -2533,12 +2526,6 @@ cdef class GapElement_Function(GapElement):
25332526
arg_list = make_gap_list(args)
25342527
result = GAP_CallFuncList(self.value, arg_list)
25352528
sig_off()
2536-
sig_on_called = False
2537-
except Exception:
2538-
# If any exception occurred, ensure we clean up properly
2539-
if sig_on_called:
2540-
sig_off()
2541-
raise
25422529
finally:
25432530
GAP_Leave()
25442531
if result == NULL:

0 commit comments

Comments
 (0)