Skip to content

Commit 5dfa06c

Browse files
author
Matthias Koeppe
committed
src/sage/repl/ipython_kernel/interact.py: Sort imports, replace relative imports, remove duplicate import, separate out lazy_import
1 parent 9dbe263 commit 5dfa06c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/sage/repl/ipython_kernel/interact.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@
4040
from ipywidgets.widgets import SelectionSlider, ValueWidget, ToggleButtons
4141
from ipywidgets.widgets.interaction import interactive, signature
4242

43-
from .widgets import EvalText, SageColorPicker
44-
from sage.structure.element import parent
4543
import sage.rings.abc
44+
4645
from sage.misc.lazy_import import lazy_import
47-
from sage.structure.element import Matrix
46+
from sage.repl.ipython_kernel.widgets import EvalText, SageColorPicker
47+
from sage.structure.element import Matrix, parent
48+
4849
lazy_import("sage.plot.colors", "Color")
4950

5051

@@ -176,13 +177,8 @@ def widget_from_single_value(cls, abbrev, *args, **kwds):
176177
return input_grid(abbrev.nrows(), abbrev.ncols(),
177178
default=abbrev.list(), to_value=abbrev.parent())
178179

179-
try:
180-
from sage.plot.colors import Color
181-
except ImportError:
182-
pass
183-
else:
184-
if isinstance(abbrev, Color):
185-
return SageColorPicker(value=abbrev.html_color())
180+
if isinstance(abbrev, Color):
181+
return SageColorPicker(value=abbrev.html_color())
186182
# Get widget from IPython if possible
187183
widget = super().widget_from_single_value(abbrev, *args, **kwds)
188184
if widget is not None or isinstance(abbrev, Iterable):

0 commit comments

Comments
 (0)