Show More
@@ -533,20 +533,6 b' class CachedOutput:' | |||
|
533 | 533 | except KeyError: |
|
534 | 534 | pass |
|
535 | 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 | 536 | cout_write = Term.cout.write # fast lookup |
|
551 | 537 | # first handle the cache and counters |
|
552 | 538 | |
@@ -566,6 +552,22 b' class CachedOutput:' | |||
|
566 | 552 | else: |
|
567 | 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 | 571 | # avoid recursive reference when displaying _oh/Out |
|
570 | 572 | if arg is not self.user_ns['_oh']: |
|
571 | 573 | self.update(arg) |
General Comments 0
You need to be logged in to leave comments.
Login now