forked from python-trio/trio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Trio's excepthook play nicely with Ubuntu's excepthook
Fixes python-triogh-1065
- Loading branch information
Showing
5 changed files
with
88 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
On Ubuntu systems, the system Python includes a custom | ||
unhandled-exception hook to perform `crash reporting | ||
<https://wiki.ubuntu.com/Apport>`__. Unfortunately, Trio wants to use | ||
the same hook to print nice `MultiError` tracebacks, causing a | ||
conflict. Previously, Trio would detect the conflict, print a warning, | ||
and you just wouldn't get nice `MultiError` tracebacks. Now, Trio has | ||
gotten clever enough to integrate its hook with Ubuntu's, so the two | ||
systems should Just Work together. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
trio/_core/tests/test_multierror_scripts/apport_excepthook.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# The apport_python_hook package is only installed as part of Ubuntu's system | ||
# python, and not available in venvs. So before we can import it we have to | ||
# make sure it's on sys.path. | ||
import sys | ||
sys.path.append("/usr/lib/python3/dist-packages") | ||
import apport_python_hook | ||
apport_python_hook.install() | ||
|
||
import trio | ||
|
||
raise trio.MultiError([KeyError("key_error"), ValueError("value_error")]) |