提交 49c17d92 编写于 作者: HansBug's avatar HansBug 😆

dev(hansbug): try add the tempfile using back

上级 bfbd23d4
import codecs
import os
import shutil
import tempfile
import warnings
from collections import OrderedDict
from functools import partial
......@@ -59,7 +61,9 @@ def _save_source_code(g: Digraph, path: str):
def _save_image(g: Digraph, path: str, fmt: str):
g.render(path, format=fmt)
with tempfile.NamedTemporaryFile() as tmpfile:
svg_file = g.render(tmpfile.name, format=fmt)
shutil.copy(svg_file, path)
_IMAGE_FMTS = {'svg', 'png'}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册