diff options
author | Aurelien Campeas <devnull@localhost> | 2009-09-08 20:07:16 +0200 |
---|---|---|
committer | Aurelien Campeas <devnull@localhost> | 2009-09-08 20:07:16 +0200 |
commit | f819e856e6bd9e09797c2480c310c7e5c51b0f23 (patch) | |
tree | 104efcfb852e0e9bfa42377458bfa8672b3a36bb /graph.py | |
parent | c24c4f2a0553563c974047a699245d42d1f712c1 (diff) | |
download | logilab-common-f819e856e6bd9e09797c2480c310c7e5c51b0f23.tar.gz |
win32 adjustments
Diffstat (limited to 'graph.py')
-rw-r--r-- | graph.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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): |