Skip to content

Commit c9ababb

Browse files
author
pipolose
committed
Proper fix of write_dot error for networkx>=1.11 in nipype/pipeline/utils.py
1 parent f8740c6 commit c9ababb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nipype/pipeline/engine/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import numpy as np
2828
from nipype.utils.misc import package_check
2929
from functools import reduce
30+
from distutils.version import LooseVersion
3031

3132
package_check('networkx', '1.3')
3233

@@ -1021,7 +1022,7 @@ def export_graph(graph_in, base_dir=None, show=False, use_execgraph=False,
10211022
suffix='.dot',
10221023
use_ext=False,
10231024
newpath=base_dir)
1024-
if float(nx.__version__)<1.11:
1025+
if LooseVersion(nx.__version__) < LooseVersion('1.11'):
10251026
nx.write_dot(pklgraph, outfname)
10261027
else:
10271028
nx.drawing.nx_pydot.write_dot(pklgraph, outfname)

0 commit comments

Comments
 (0)