File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -379,13 +379,14 @@ def __str__(self):
379
379
__repr__ = __str__
380
380
381
381
def _ipython_display_ (self , ** kwargs ): # pragma: no cover
382
+ # Since this function is only called by jupyter, this import must succeed
383
+ from IPython .display import HTML , display
384
+
382
385
try :
383
386
import ipywidgets
384
387
from IPython .core .interactiveshell import InteractiveShell
385
388
output = ipywidgets .Output (_view_count = 0 )
386
389
except ImportError :
387
- # since this function is only called by jupyter, this import must succeed
388
- from IPython .display import display , HTML
389
390
if hasattr (self , '_repr_html_' ):
390
391
return display (HTML (self ._repr_html_ ()))
391
392
else :
@@ -420,7 +421,11 @@ def remove_stream(change):
420
421
421
422
output .observe (remove_stream , '_view_count' )
422
423
423
- return output ._ipython_display_ (** kwargs )
424
+ if hasattr (output , "_repr_mimebundle_" ):
425
+ data = output ._repr_mimebundle_ (** kwargs )
426
+ return display (data , raw = True )
427
+ else :
428
+ return output ._ipython_display_ (** kwargs )
424
429
425
430
def _emit (self , x , metadata = None ):
426
431
"""
You can’t perform that action at this time.
0 commit comments