##// END OF EJS Templates
flush stdout/err before printing tracebacks
fperez -
Show More
@@ -60,7 +60,7 b' You can implement other color schemes easily, the syntax is fairly'
60 self-explanatory. Please send back new schemes you develop to the author for
60 self-explanatory. Please send back new schemes you develop to the author for
61 possible inclusion in future releases.
61 possible inclusion in future releases.
62
62
63 $Id: ultraTB.py 1956 2006-11-30 05:22:31Z fperez $"""
63 $Id: ultraTB.py 2027 2007-01-19 00:55:09Z fperez $"""
64
64
65 #*****************************************************************************
65 #*****************************************************************************
66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
66 # Copyright (C) 2001 Nathaniel Gray <n8gray@caltech.edu>
@@ -248,6 +248,8 b' class ListTB(TBTools):'
248 TBTools.__init__(self,color_scheme = color_scheme,call_pdb=0)
248 TBTools.__init__(self,color_scheme = color_scheme,call_pdb=0)
249
249
250 def __call__(self, etype, value, elist):
250 def __call__(self, etype, value, elist):
251 Term.cout.flush()
252 Term.cerr.flush()
251 print >> Term.cerr, self.text(etype,value,elist)
253 print >> Term.cerr, self.text(etype,value,elist)
252
254
253 def text(self,etype, value, elist,context=5):
255 def text(self,etype, value, elist,context=5):
@@ -716,6 +718,8 b' class VerboseTB(TBTools):'
716 def handler(self, info=None):
718 def handler(self, info=None):
717 (etype, evalue, etb) = info or sys.exc_info()
719 (etype, evalue, etb) = info or sys.exc_info()
718 self.tb = etb
720 self.tb = etb
721 Term.cout.flush()
722 Term.cerr.flush()
719 print >> Term.cerr, self.text(etype, evalue, etb)
723 print >> Term.cerr, self.text(etype, evalue, etb)
720
724
721 # Changed so an instance can just be called as VerboseTB_inst() and print
725 # Changed so an instance can just be called as VerboseTB_inst() and print
@@ -833,6 +837,8 b' class AutoFormattedTB(FormattedTB):'
833
837
834 if out is None:
838 if out is None:
835 out = Term.cerr
839 out = Term.cerr
840 Term.cout.flush()
841 out.flush()
836 if tb_offset is not None:
842 if tb_offset is not None:
837 tb_offset, self.tb_offset = self.tb_offset, tb_offset
843 tb_offset, self.tb_offset = self.tb_offset, tb_offset
838 print >> out, self.text(etype, evalue, etb)
844 print >> out, self.text(etype, evalue, etb)
@@ -1,3 +1,9 b''
1 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
4 all output streams before printing tracebacks. This ensures that
5 user output doesn't end up interleaved with traceback output.
6
1 2007-01-10 Ville Vainio <vivainio@gmail.com>
7 2007-01-10 Ville Vainio <vivainio@gmail.com>
2
8
3 * Extensions/envpersist.py: Turbocharged %env that remembers
9 * Extensions/envpersist.py: Turbocharged %env that remembers
General Comments 0
You need to be logged in to leave comments. Login now