Show More
@@ -560,25 +560,25 b' more other types of exceptions. Here is how it works:' | |||||
560 | In [79]: dview.execute("1/0") |
|
560 | In [79]: dview.execute("1/0") | |
561 | [0:execute]: |
|
561 | [0:execute]: | |
562 | --------------------------------------------------------------------------- |
|
562 | --------------------------------------------------------------------------- | |
563 |
ZeroDivisionError Traceback (most recent call last) |
|
563 | ZeroDivisionError Traceback (most recent call last) | |
564 | ----> 1 1/0 |
|
564 | ----> 1 1/0 | |
565 | ZeroDivisionError: integer division or modulo by zero |
|
565 | ZeroDivisionError: integer division or modulo by zero | |
566 |
|
566 | |||
567 | [1:execute]: |
|
567 | [1:execute]: | |
568 | --------------------------------------------------------------------------- |
|
568 | --------------------------------------------------------------------------- | |
569 |
ZeroDivisionError Traceback (most recent call last) |
|
569 | ZeroDivisionError Traceback (most recent call last) | |
570 | ----> 1 1/0 |
|
570 | ----> 1 1/0 | |
571 | ZeroDivisionError: integer division or modulo by zero |
|
571 | ZeroDivisionError: integer division or modulo by zero | |
572 |
|
572 | |||
573 | [2:execute]: |
|
573 | [2:execute]: | |
574 | --------------------------------------------------------------------------- |
|
574 | --------------------------------------------------------------------------- | |
575 |
ZeroDivisionError Traceback (most recent call last) |
|
575 | ZeroDivisionError Traceback (most recent call last) | |
576 | ----> 1 1/0 |
|
576 | ----> 1 1/0 | |
577 | ZeroDivisionError: integer division or modulo by zero |
|
577 | ZeroDivisionError: integer division or modulo by zero | |
578 |
|
578 | |||
579 | [3:execute]: |
|
579 | [3:execute]: | |
580 | --------------------------------------------------------------------------- |
|
580 | --------------------------------------------------------------------------- | |
581 |
ZeroDivisionError Traceback (most recent call last) |
|
581 | ZeroDivisionError Traceback (most recent call last) | |
582 | ----> 1 1/0 |
|
582 | ----> 1 1/0 | |
583 | ZeroDivisionError: integer division or modulo by zero |
|
583 | ZeroDivisionError: integer division or modulo by zero | |
584 |
|
584 | |||
@@ -595,7 +595,7 b' If you want, you can even raise one of these original exceptions:' | |||||
595 | ....: |
|
595 | ....: | |
596 | ....: |
|
596 | ....: | |
597 | --------------------------------------------------------------------------- |
|
597 | --------------------------------------------------------------------------- | |
598 |
ZeroDivisionError Traceback (most recent call last) |
|
598 | ZeroDivisionError Traceback (most recent call last) | |
599 | ----> 1 1/0 |
|
599 | ----> 1 1/0 | |
600 | ZeroDivisionError: integer division or modulo by zero |
|
600 | ZeroDivisionError: integer division or modulo by zero | |
601 |
|
601 | |||
@@ -608,25 +608,25 b' instance:' | |||||
608 | In [81]: dview.execute('1/0') |
|
608 | In [81]: dview.execute('1/0') | |
609 | [0:execute]: |
|
609 | [0:execute]: | |
610 | --------------------------------------------------------------------------- |
|
610 | --------------------------------------------------------------------------- | |
611 |
ZeroDivisionError Traceback (most recent call last) |
|
611 | ZeroDivisionError Traceback (most recent call last) | |
612 | ----> 1 1/0 |
|
612 | ----> 1 1/0 | |
613 | ZeroDivisionError: integer division or modulo by zero |
|
613 | ZeroDivisionError: integer division or modulo by zero | |
614 |
|
614 | |||
615 | [1:execute]: |
|
615 | [1:execute]: | |
616 | --------------------------------------------------------------------------- |
|
616 | --------------------------------------------------------------------------- | |
617 |
ZeroDivisionError Traceback (most recent call last) |
|
617 | ZeroDivisionError Traceback (most recent call last) | |
618 | ----> 1 1/0 |
|
618 | ----> 1 1/0 | |
619 | ZeroDivisionError: integer division or modulo by zero |
|
619 | ZeroDivisionError: integer division or modulo by zero | |
620 |
|
620 | |||
621 | [2:execute]: |
|
621 | [2:execute]: | |
622 | --------------------------------------------------------------------------- |
|
622 | --------------------------------------------------------------------------- | |
623 |
ZeroDivisionError Traceback (most recent call last) |
|
623 | ZeroDivisionError Traceback (most recent call last) | |
624 | ----> 1 1/0 |
|
624 | ----> 1 1/0 | |
625 | ZeroDivisionError: integer division or modulo by zero |
|
625 | ZeroDivisionError: integer division or modulo by zero | |
626 |
|
626 | |||
627 | [3:execute]: |
|
627 | [3:execute]: | |
628 | --------------------------------------------------------------------------- |
|
628 | --------------------------------------------------------------------------- | |
629 |
ZeroDivisionError Traceback (most recent call last) |
|
629 | ZeroDivisionError Traceback (most recent call last) | |
630 | ----> 1 1/0 |
|
630 | ----> 1 1/0 | |
631 | ZeroDivisionError: integer division or modulo by zero |
|
631 | ZeroDivisionError: integer division or modulo by zero | |
632 |
|
632 | |||
@@ -654,11 +654,31 b' instance:' | |||||
654 | ipdb> e.print_traceback(1) |
|
654 | ipdb> e.print_traceback(1) | |
655 | [1:execute]: |
|
655 | [1:execute]: | |
656 | --------------------------------------------------------------------------- |
|
656 | --------------------------------------------------------------------------- | |
657 |
ZeroDivisionError Traceback (most recent call last) |
|
657 | ZeroDivisionError Traceback (most recent call last) | |
658 | ----> 1 1/0 |
|
658 | ----> 1 1/0 | |
659 | ZeroDivisionError: integer division or modulo by zero |
|
659 | ZeroDivisionError: integer division or modulo by zero | |
660 |
|
660 | |||
661 |
|
661 | |||
|
662 | Since you might have 100 engines, you probably don't want to see 100 tracebacks | |||
|
663 | for a simple NameError because of a typo. | |||
|
664 | For this reason, CompositeError truncates the list of exceptions it will print | |||
|
665 | to :attr:`CompositeError.tb_limit` (default is five). | |||
|
666 | You can change this limit to suit your needs with: | |||
|
667 | ||||
|
668 | .. sourcecode:: ipython | |||
|
669 | ||||
|
670 | In [20]: from IPython.parallel import CompositeError | |||
|
671 | In [21]: CompositeError.tb_limit = 1 | |||
|
672 | In [22]: %px a=b | |||
|
673 | [0:execute]: | |||
|
674 | --------------------------------------------------------------------------- | |||
|
675 | NameError Traceback (most recent call last) | |||
|
676 | ----> 1 a=b | |||
|
677 | NameError: name 'b' is not defined | |||
|
678 | ||||
|
679 | ... 3 more exceptions ... | |||
|
680 | ||||
|
681 | ||||
662 | All of this same error handling magic even works in non-blocking mode: |
|
682 | All of this same error handling magic even works in non-blocking mode: | |
663 |
|
683 | |||
664 | .. sourcecode:: ipython |
|
684 | .. sourcecode:: ipython | |
@@ -670,25 +690,8 b' All of this same error handling magic even works in non-blocking mode:' | |||||
670 | In [85]: ar.get() |
|
690 | In [85]: ar.get() | |
671 | [0:execute]: |
|
691 | [0:execute]: | |
672 | --------------------------------------------------------------------------- |
|
692 | --------------------------------------------------------------------------- | |
673 |
ZeroDivisionError Traceback (most recent call last) |
|
693 | ZeroDivisionError Traceback (most recent call last) | |
674 | ----> 1 1/0 |
|
|||
675 | ZeroDivisionError: integer division or modulo by zero |
|
|||
676 |
|
||||
677 | [1:execute]: |
|
|||
678 | --------------------------------------------------------------------------- |
|
|||
679 | ZeroDivisionError Traceback (most recent call last)<ipython-input-1-05c9758a9c21> in <module>() |
|
|||
680 | ----> 1 1/0 |
|
694 | ----> 1 1/0 | |
681 | ZeroDivisionError: integer division or modulo by zero |
|
695 | ZeroDivisionError: integer division or modulo by zero | |
682 |
|
696 | |||
683 | [2:execute]: |
|
697 | ... 3 more exceptions ... | |
684 | --------------------------------------------------------------------------- |
|
|||
685 | ZeroDivisionError Traceback (most recent call last)<ipython-input-1-05c9758a9c21> in <module>() |
|
|||
686 | ----> 1 1/0 |
|
|||
687 | ZeroDivisionError: integer division or modulo by zero |
|
|||
688 |
|
||||
689 | [3:execute]: |
|
|||
690 | --------------------------------------------------------------------------- |
|
|||
691 | ZeroDivisionError Traceback (most recent call last)<ipython-input-1-05c9758a9c21> in <module>() |
|
|||
692 | ----> 1 1/0 |
|
|||
693 | ZeroDivisionError: integer division or modulo by zero |
|
|||
694 |
|
General Comments 0
You need to be logged in to leave comments.
Login now