Skip to content

Commit d726613

Browse files
author
Matthias Koeppe
committed
NumberField._pushout_: If AA, QQbar cannot be imported, just return None
1 parent 0fd5967 commit d726613

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/sage/rings/number_field/number_field_base.pyx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,15 @@ cdef class NumberField(Field):
135135
else:
136136
codomain_other = other
137137

138-
from sage.rings.qqbar import AA
139-
if codomain_self is AA and codomain_other is AA:
140-
return AA
141-
142-
from sage.rings.qqbar import QQbar
143-
if codomain_self in (AA, QQbar) and codomain_other in (AA, QQbar):
144-
return QQbar
138+
try:
139+
from sage.rings.qqbar import AA, QQbar
140+
except ImportError:
141+
pass
142+
else:
143+
if codomain_self is AA and codomain_other is AA:
144+
return AA
145+
if codomain_self in (AA, QQbar) and codomain_other in (AA, QQbar):
146+
return QQbar
145147

146148
def ring_of_integers(self, *args, **kwds):
147149
r"""

0 commit comments

Comments
 (0)