Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage: don't import stuff in low level functions #239

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/fpylll/io.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ IF HAVE_QD:
from fpylll.fplll.fplll cimport FT_DD, FT_QD

try:
from sage.all import ZZ
from sage.rings.integer import Integer
have_sage = True
except Exception:
have_sage = False
Expand Down Expand Up @@ -44,7 +44,6 @@ cdef int assign_mpz(mpz_t& t, value) except -1:
mpz_set_pylong(t, value)
return 0
if have_sage:
from sage.rings.integer import Integer
if isinstance(value, Integer):
value = long(value)
mpz_set_pylong(t, value)
Expand All @@ -55,7 +54,6 @@ cdef int assign_mpz(mpz_t& t, value) except -1:
cdef object mpz_get_python(mpz_srcptr z):
r = mpz_get_pyintlong(z)
if have_sage:
from sage.rings.integer import Integer
return Integer(r)
else:
return r
Expand Down