summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
authorAurelien Campeas <devnull@localhost>2009-09-08 20:07:16 +0200
committerAurelien Campeas <devnull@localhost>2009-09-08 20:07:16 +0200
commitf819e856e6bd9e09797c2480c310c7e5c51b0f23 (patch)
tree104efcfb852e0e9bfa42377458bfa8672b3a36bb /graph.py
parentc24c4f2a0553563c974047a699245d42d1f712c1 (diff)
downloadlogilab-common-f819e856e6bd9e09797c2480c310c7e5c51b0f23.tar.gz
win32 adjustments
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/graph.py b/graph.py
index df5d838..32deb0b 100644
--- a/graph.py
+++ b/graph.py
@@ -12,6 +12,8 @@ __metaclass__ = type
import os.path as osp
import os
+import subprocess
+import sys
import tempfile
def escape(value):
@@ -93,9 +95,13 @@ class DotBackend:
pdot.write(self.source)
pdot.close()
if target != 'dot':
- os.system('%s -T%s %s -o%s' % (self.renderer, target,
- dot_sourcepath, outputfile))
- os.unlink(dot_sourcepath)
+ subprocess.call('%s -T%s %s -o%s' % (self.renderer, target,
+ dot_sourcepath, outputfile), shell=True)
+ try:
+ os.unlink(dot_sourcepath)
+ except OSError:
+ if sys.platform != 'win32':
+ raise
return outputfile
def emit(self, line):