Commit b15db24
committed
Improve handling of KeyboardInterrupt and task cancellation in SCP
This commit makes sure to re-raise CancelledError when an SCP operation
is cancelled, letting the calling code sees the exception and can decide
whether to cancel future operations or not. Thanks go to Viktor Kertesz
for reporting this issue and helping to understand the behavior in
various versions of Python.
This also includes a small change to abort an SCP session when
KeyboardInterrupt is raised, closing the session more quickly.1 parent 5f3bf9d commit b15db24
2 files changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
582 | | - | |
| 582 | + | |
583 | 583 | | |
| 584 | + | |
584 | 585 | | |
585 | 586 | | |
586 | 587 | | |
| |||
745 | 746 | | |
746 | 747 | | |
747 | 748 | | |
748 | | - | |
| 749 | + | |
749 | 750 | | |
| 751 | + | |
750 | 752 | | |
751 | 753 | | |
752 | 754 | | |
| |||
911 | 913 | | |
912 | 914 | | |
913 | 915 | | |
914 | | - | |
| 916 | + | |
915 | 917 | | |
| 918 | + | |
916 | 919 | | |
917 | 920 | | |
918 | 921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5047 | 5047 | | |
5048 | 5048 | | |
5049 | 5049 | | |
5050 | | - | |
5051 | 5050 | | |
5052 | | - | |
| 5051 | + | |
| 5052 | + | |
| 5053 | + | |
5053 | 5054 | | |
5054 | 5055 | | |
5055 | 5056 | | |
| |||
0 commit comments