diff options
author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2011-03-02 16:59:31 +0100 |
---|---|---|
committer | Alexandre Fayolle <alexandre.fayolle@logilab.fr> | 2011-03-02 16:59:31 +0100 |
commit | f9991cf01612a07446a1542ba4d33ae7b6cf7461 (patch) | |
tree | 691ce961ea631572310338fa805ce68ecb820356 | |
parent | 7b67e09e06d8d9c96b9ff36934ca7427036c3a74 (diff) | |
download | logilab-common-f9991cf01612a07446a1542ba4d33ae7b6cf7461.tar.gz |
fix call to dot via subprocess: linux seems to need the shell=False, while windows requires shell=True...
-rw-r--r-- | graph.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -110,13 +110,17 @@ class DotBackend: pdot.write(str_encode(self.source, 'utf8')) pdot.close() if target != 'dot': + if sys.platform == 'win32': + use_shell = True + else: + use_shell = False if mapfile: subprocess.call([self.renderer, '-Tcmapx', '-o', mapfile, '-T', target, dot_sourcepath, '-o', outputfile], - shell=True) + shell=use_shell) else: subprocess.call([self.renderer, '-T', target, dot_sourcepath, '-o', outputfile], - shell=True) + shell=use_shell) os.unlink(dot_sourcepath) return outputfile |