summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graph.py12
-rw-r--r--logging_ext.py2
2 files changed, 10 insertions, 4 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):
diff --git a/logging_ext.py b/logging_ext.py
index 4fce3a7..5a27d05 100644
--- a/logging_ext.py
+++ b/logging_ext.py
@@ -118,7 +118,7 @@ def init_log(debug=False, syslog=False, logthreshold=None, logfile=None,
# setHandler method, so do it this way :$
logger.handlers = [handler]
isatty = hasattr(sys.__stdout__, 'isatty') and sys.__stdout__.isatty()
- if debug and isatty:
+ if debug and isatty and sys.platform != 'win32':
fmt = ColorFormatter(logformat, logdateformat)
def col_fact(record):
if 'XXX' in record.message: