Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Following #27140 make_any_gap_element() is not called
Browse files Browse the repository at this point in the history
inside sig_on() anymore
  • Loading branch information
Simon Brandhorst committed Mar 10, 2019
1 parent 1040752 commit 46557d6
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions src/sage/libs/gap/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -904,14 +904,14 @@ cdef class GapElement(RingElement):
Error, no 1st choice method found for `+' on 2 arguments
"""
cdef Obj result
sig_on()
try:
GAP_Enter()
sig_GAP_Enter()
sig_on()
result = SUM(self.value, (<GapElement>right).value)
return make_any_gap_element(self.parent(), result)
sig_off()
finally:
GAP_Leave()
sig_off()
return make_any_gap_element(self.parent(), result)

cpdef _sub_(self, right):
r"""
Expand All @@ -932,14 +932,14 @@ cdef class GapElement(RingElement):
GAPError: Error, no method found! ...
"""
cdef Obj result
sig_on()
try:
GAP_Enter()
sig_GAP_Enter()
sig_on()
result = DIFF(self.value, (<GapElement>right).value)
return make_any_gap_element(self.parent(), result)
sig_off()
finally:
GAP_Leave()
sig_off()
return make_any_gap_element(self.parent(), result)


cpdef _mul_(self, right):
Expand All @@ -962,14 +962,14 @@ cdef class GapElement(RingElement):
Error, no 1st choice method found for `*' on 2 arguments
"""
cdef Obj result
sig_on()
try:
GAP_Enter()
sig_GAP_Enter()
sig_on()
result = PROD(self.value, (<GapElement>right).value)
return make_any_gap_element(self.parent(), result)
sig_off()
finally:
GAP_Leave()
sig_off()
return make_any_gap_element(self.parent(), result)

cpdef _div_(self, right):
r"""
Expand All @@ -996,14 +996,14 @@ cdef class GapElement(RingElement):
GAPError: Error, Rational operations: <divisor> must not be zero
"""
cdef Obj result
sig_on()
try:
GAP_Enter()
sig_GAP_Enter()
sig_on()
result = QUO(self.value, (<GapElement>right).value)
return make_any_gap_element(self.parent(), result)
sig_off()
finally:
GAP_Leave()
sig_off()
return make_any_gap_element(self.parent(), result)

cpdef _mod_(self, right):
r"""
Expand All @@ -1023,14 +1023,14 @@ cdef class GapElement(RingElement):
Error, no 1st choice method found for `mod' on 2 arguments
"""
cdef Obj result
sig_on()
try:
GAP_Enter()
sig_GAP_Enter()
sig_on()
result = MOD(self.value, (<GapElement>right).value)
return make_any_gap_element(self.parent(), result)
sig_off()
finally:
GAP_Leave()
sig_off()
return make_any_gap_element(self.parent(), result)

cpdef _pow_(self, other):
r"""
Expand Down Expand Up @@ -2407,9 +2407,9 @@ cdef class GapElement_Function(GapElement):
libgap = self.parent()
a = [x if isinstance(x, GapElement) else libgap(x) for x in args]

sig_on()
try:
GAP_Enter()
sig_GAP_Enter()
sig_on()
if n == 0:
result = CALL_0ARGS(self.value)
elif n == 1:
Expand Down Expand Up @@ -2448,15 +2448,13 @@ cdef class GapElement_Function(GapElement):
elif n >= 7:
arg_list = make_gap_list(args)
result = CALL_XARGS(self.value, arg_list)

if result == NULL:
# We called a procedure that does not return anything
return None

return make_any_gap_element(self.parent(), result)
sig_off()
finally:
GAP_Leave()
sig_off()
if result == NULL:
# We called a procedure that does not return anything
return None
return make_any_gap_element(self.parent(), result)



Expand Down Expand Up @@ -3105,10 +3103,10 @@ cdef class GapElement_Record(GapElement):
try:
GAP_Enter()
result = ELM_REC(self.value, i)
return make_any_gap_element(self.parent(), result)
finally:
GAP_Leave()
sig_off()
return make_any_gap_element(self.parent(), result)

def sage(self):
r"""
Expand Down

0 comments on commit 46557d6

Please sign in to comment.