提交 1b55e55e authored 作者: Frederic Bastien's avatar Frederic Bastien

Use a prefered way and clearer way to have code work with python 2 and 3.

上级 b433d702
...@@ -1028,7 +1028,7 @@ def pydotprint(fct, outfile=None, ...@@ -1028,7 +1028,7 @@ def pydotprint(fct, outfile=None,
except pd.InvocationException: except pd.InvocationException:
# based on https://github.com/Theano/Theano/issues/2988 # based on https://github.com/Theano/Theano/issues/2988
version = getattr(pd, '__version__', "") version = getattr(pd, '__version__', "")
if version and list(map(int, version.split("."))) < [1, 0, 28]: if version and [int(n) for n in version.split(".")] < [1, 0, 28]:
raise Exception("Old version of pydot detected, which can " raise Exception("Old version of pydot detected, which can "
"cause issues with pydot printing. Try " "cause issues with pydot printing. Try "
"upgrading pydot version to a newer one") "upgrading pydot version to a newer one")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论