##// END OF EJS Templates
Fix bug where output prompts were coming *after* output values....
Fernando Perez -
Show More
@@ -533,20 +533,6 b' class CachedOutput:'
533 except KeyError:
533 except KeyError:
534 pass
534 pass
535 if arg is not None:
535 if arg is not None:
536
537 # and now call a possibly user-defined print mechanism
538 try:
539 manipulated_val = self.display(arg)
540 except TypeError:
541 # If the user's display hook didn't return a string we can
542 # print, we're done. Happens commonly if they return None
543 return
544
545 # user display hooks can change the variable to be stored in
546 # output history
547 if manipulated_val is not None:
548 arg = manipulated_val
549
550 cout_write = Term.cout.write # fast lookup
536 cout_write = Term.cout.write # fast lookup
551 # first handle the cache and counters
537 # first handle the cache and counters
552
538
@@ -566,6 +552,22 b' class CachedOutput:'
566 else:
552 else:
567 print "self.do_full_cache = False"
553 print "self.do_full_cache = False"
568
554
555 # and now call a possibly user-defined print mechanism. Note that
556 # self.display typically prints as a side-effect, we don't do any
557 # printing to stdout here.
558 try:
559 manipulated_val = self.display(arg)
560 except TypeError:
561 # If the user's display hook didn't return a string we can
562 # print, we're done. Happens commonly if they return None
563 cout_write('\n')
564 return
565
566 # user display hooks can change the variable to be stored in
567 # output history
568 if manipulated_val is not None:
569 arg = manipulated_val
570
569 # avoid recursive reference when displaying _oh/Out
571 # avoid recursive reference when displaying _oh/Out
570 if arg is not self.user_ns['_oh']:
572 if arg is not self.user_ns['_oh']:
571 self.update(arg)
573 self.update(arg)
@@ -36,5 +36,6 b' class Quitter(object):'
36
36
37 def __call__(self):
37 def __call__(self):
38 self.shell.ask_exit()
38 self.shell.ask_exit()
39 return 'Bye.'
39
40
40 __repr__ = __call__
41 __repr__ = __call__
General Comments 0
You need to be logged in to leave comments. Login now