Skip to content

Commit 704259f

Browse files
committed
Don't 404.
1 parent 947195c commit 704259f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

filprofiler/_ipython.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from tempfile import mkdtemp
99

1010
from IPython.core.magic import Magics, magics_class, cell_magic
11-
from IPython.display import IFrame, display
11+
from IPython.display import IFrame, display, HTML
1212

1313
from .api import profile
1414

@@ -66,4 +66,7 @@ def run_with_profile(code_to_profile):
6666
return profile(code_to_profile, tempdir)
6767
finally:
6868
svg_path = tempdir / "peak-memory.svg"
69-
display(IFrame(svg_path, width="100%", height="600"))
69+
if svg_path.exists():
70+
display(IFrame(svg_path, width="100%", height="600"))
71+
else:
72+
display(HTML("No report generated, perhaps zero memory was allocated."))

0 commit comments

Comments
 (0)