From 4ef163acbdb920981358a899098cf35d71512ecb 2014-06-26 20:21:26 From: Julia Evans Date: 2014-06-26 20:21:26 Subject: [PATCH] Do self.log.error instead print >> sys.stderr --- diff --git a/IPython/nbconvert/preprocessors/execute.py b/IPython/nbconvert/preprocessors/execute.py index 62b9944..a06373b 100644 --- a/IPython/nbconvert/preprocessors/execute.py +++ b/IPython/nbconvert/preprocessors/execute.py @@ -50,8 +50,8 @@ class ExecutePreprocessor(Preprocessor): try: outputs = self.run_cell(self.shell, self.iopub, cell) except Exception as e: - print >> sys.stderr, "failed to run cell:", repr(e) - print >> sys.stderr, cell.input + self.log.error("failed to run cell: " + repr(e)) + self.log.error(str(cell.input)) sys.exit(1) cell.outputs = outputs return cell, resources @@ -97,7 +97,7 @@ class ExecutePreprocessor(Preprocessor): out.evalue = content['evalue'] out.traceback = content['traceback'] else: - print >> sys.stderr, "unhandled iopub msg:", msg_type + self.log.error("unhandled iopub msg: " + msg_type) outs.append(out) return outs