summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>2011-03-02 16:59:31 +0100
committerAlexandre Fayolle <alexandre.fayolle@logilab.fr>2011-03-02 16:59:31 +0100
commitf9991cf01612a07446a1542ba4d33ae7b6cf7461 (patch)
tree691ce961ea631572310338fa805ce68ecb820356 /graph.py
parent7b67e09e06d8d9c96b9ff36934ca7427036c3a74 (diff)
downloadlogilab-common-f9991cf01612a07446a1542ba4d33ae7b6cf7461.tar.gz
fix call to dot via subprocess: linux seems to need the shell=False, while windows requires shell=True...
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/graph.py b/graph.py
index e4d8e8a..7321f69 100644
--- a/graph.py
+++ b/graph.py
@@ -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