summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/graph.py b/graph.py
index c340655..50d2bbe 100644
--- a/graph.py
+++ b/graph.py
@@ -78,7 +78,9 @@ class DotBackend:
outputfile = osp.join(storedir, basename)
dotfile = dotfile or ('%s.dot' % self.graphname)
dot_sourcepath = osp.join(storedir, dotfile)
- pdot = file(dot_sourcepath, 'w')
+ if target != 'dot':
+ dot_sourcepath = osp.join('/tmp', dotfile)
+ pdot = open(dot_sourcepath, 'w')
if isinstance(self.source, unicode):
pdot.write(self.source.encode('UTF8'))
else: