@@ -133,7 +133,7 @@ def __setattr__(self, name, value):
133133 if scope .mathjax is None :
134134 with warnings .catch_warnings ():
135135 warnings .filterwarnings (
136- "ignore" , message = ".*scope\.mathjax.*" , category = DeprecationWarning
136+ "ignore" , message = r ".*scope\.mathjax.*" , category = DeprecationWarning
137137 )
138138 scope .mathjax = (
139139 "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"
@@ -351,8 +351,6 @@ def to_image(
351351 $ pip install kaleido<1.0.0
352352"""
353353 )
354- import choreographer
355-
356354 try :
357355 # TODO: Refactor to make it possible to use a shared Kaleido instance here
358356 img_bytes = kaleido .calc_fig_sync (
@@ -366,7 +364,7 @@ def to_image(
366364 topojson = defaults .topojson ,
367365 # mathjax=Path(defaults.mathjax).as_uri() if defaults.mathjax else None,
368366 )
369- except choreographer .errors .ChromeNotFoundError :
367+ except kaleido .errors .ChromeNotFoundError :
370368 raise RuntimeError (PLOTLY_GET_CHROME_ERROR_MSG )
371369
372370 else :
@@ -638,11 +636,9 @@ def write_images(
638636 for d in arg_dicts
639637 ]
640638
641- import choreographer
642-
643639 try :
644640 kaleido .write_fig_from_object_sync (kaleido_specs )
645- except choreographer .errors .ChromeNotFoundError :
641+ except kaleido .errors .ChromeNotFoundError :
646642 raise RuntimeError (PLOTLY_GET_CHROME_ERROR_MSG )
647643
648644
0 commit comments