Skip to content

Commit

Permalink
WIP2
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Jul 25, 2023
1 parent da2e9e6 commit f25c637
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/sage/libs/gap/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ cdef Obj make_gap_list(sage_list) except NULL:
The list of the elements in ``a`` as a Gap ``Obj``.
"""
cdef GapElement l = libgap(GAP_NewPlist(0))
cdef GapElement l
cdef GapElement elem
try:
GAP_Enter()
l = libgap(GAP_NewPlist(0))
finally:
GAP_Leave()

for x in sage_list:
if not isinstance(x, GapElement):
elem = <GapElement>libgap(x)
Expand Down Expand Up @@ -77,9 +83,15 @@ cdef Obj make_gap_matrix(sage_list, gap_ring) except NULL:
The list of the elements in ``sage_list`` as a Gap ``Obj``.
"""
cdef GapElement l = libgap(GAP_NewPlist(0))
cdef GapElement l
cdef GapElement elem
cdef GapElement one
try:
GAP_Enter()
l = libgap(GAP_NewPlist(0))
finally:
GAP_Leave()

if gap_ring is not None:
one = <GapElement>gap_ring.One()
else:
Expand Down

0 comments on commit f25c637

Please sign in to comment.