提交 4d69aead authored 作者: Sergei Lebedev's avatar Sergei Lebedev

Fix Python3 regression in ``pydotprint``

In Python3 ``map`` returns a map-object (and not a list). This makes the check introduced in #3057 fail with "TypeError: unorderable types: map() < list()"
上级 54186290
...@@ -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 map(int, version.split(".")) < [1, 0, 28]: if version and list(map(int, 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论