Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32f8987

Browse filesBrowse files
Revert "Set cell_number to 0 if history is not available"
This reverts commit 4f6201b.
1 parent ae8fb24 commit 32f8987
Copy full SHA for 32f8987

File tree

1 file changed

+3
-6
lines changed
Filter options

1 file changed

+3
-6
lines changed

‎packages/python/plotly/plotly/io/_base_renderers.py

Copy file name to clipboardExpand all lines: packages/python/plotly/plotly/io/_base_renderers.py
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,14 +609,11 @@ def to_mimebundle(self, fig_dict):
609609

610610
def build_filename(self):
611611
ip = IPython.get_ipython() if IPython else None
612-
if ip:
613-
cell_number = next(ip.history_manager.get_tail(1), (0, -1, ""))[1] + 1
614-
else:
615-
cell_number = 0
616-
617-
return "{dirname}/figure_{cell_number}.html".format(
612+
cell_number = list(ip.history_manager.get_tail(1))[0][1] + 1 if ip else 0
613+
filename = "{dirname}/figure_{cell_number}.html".format(
618614
dirname=self.html_directory, cell_number=cell_number
619615
)
616+
return filename
620617

621618
def build_url(self, filename):
622619
return filename

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.