提交 fae5d713 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #3057 from diogo149/master

Add exception when using an old version of pydot
...@@ -953,7 +953,16 @@ def pydotprint(fct, outfile=None, ...@@ -953,7 +953,16 @@ def pydotprint(fct, outfile=None,
if return_image: if return_image:
return g.create(prog='dot', format=format) return g.create(prog='dot', format=format)
else: else:
try:
g.write(outfile, prog='dot', format=format) g.write(outfile, prog='dot', format=format)
except pd.InvocationException:
# based on https://github.com/Theano/Theano/issues/2988
if map(int, pd.__version__.split(".")) < [1, 0, 28]:
raise Exception("Old version of pydot detected, which can "
"cause issues with pydot printing. Try "
"upgrading pydot version to a newer one")
raise
if print_output_file: if print_output_file:
print('The output file is available at', outfile) print('The output file is available at', outfile)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论