File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ except ImportError:
110
110
pari_gen = ()
111
111
112
112
113
+ set_rational_from_gen = None
114
+ new_gen_from_rational = None
115
+
116
+
113
117
cdef sage.rings.fast_arith.arith_int ai
114
118
ai = sage.rings.fast_arith.arith_int()
115
119
@@ -650,7 +654,9 @@ cdef class Rational(sage.structure.element.FieldElement):
650
654
mpq_canonicalize(self .value)
651
655
652
656
elif isinstance (x, pari_gen):
653
- from sage.libs.pari.convert_sage import set_rational_from_gen
657
+ global set_rational_from_gen
658
+ if set_rational_from_gen is None :
659
+ from sage.libs.pari.convert_sage import set_rational_from_gen
654
660
set_rational_from_gen(self , x)
655
661
656
662
elif isinstance (x, list ) and len (x) == 1 :
@@ -3777,7 +3783,9 @@ cdef class Rational(sage.structure.element.FieldElement):
3777
3783
sage: m.type()
3778
3784
't_FRAC'
3779
3785
"""
3780
- from sage.libs.pari.convert_sage import new_gen_from_rational
3786
+ global new_gen_from_rational
3787
+ if new_gen_from_rational is None :
3788
+ from sage.libs.pari.convert_sage import new_gen_from_rational
3781
3789
return new_gen_from_rational(self )
3782
3790
3783
3791
def _interface_init_ (self , I = None ):
You can’t perform that action at this time.
0 commit comments