Skip to content

Commit

Permalink
src/sage/rings/finite_rings/element_ntl_gf2e.pyx: Fix test for libgap…
Browse files Browse the repository at this point in the history
… element
  • Loading branch information
Matthias Koeppe committed Dec 20, 2023
1 parent 1907696 commit 9dc050d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/sage/rings/finite_rings/element_ntl_gf2e.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,17 @@ cdef class Cache_ntl_gf2e(Cache_base):
e = e.__pari__()

elif isinstance(e, GapElement):
from sage.libs.gap.element import GapElement_FiniteField

if isinstance(e, GapElement_FiniteField):
return e.sage(ring=self._parent)

from sage.libs.gap.libgap import libgap

return libgap(e).sage(ring=self._parent)

else:
try:
from sage.libs.gap.element import GapElement_FiniteField
except ImportError:
pass
else:
if isinstance(e, GapElement_FiniteField):
return e.sage(ring=self._parent)
raise TypeError("unable to coerce %r" % type(e))

cdef GEN t
Expand Down

0 comments on commit 9dc050d

Please sign in to comment.