This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/setup.py: Move excepthook to new module sage_setup.excepthook
- Loading branch information
Showing
3 changed files
with
34 additions
and
32 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,30 @@ | ||
import os | ||
import sys | ||
|
||
def excepthook(*exc): | ||
""" | ||
When an error occurs, display an error message similar to the error | ||
messages from ``sage-spkg``. | ||
In particular, ``build/make/install`` will recognize "sage" as a failed | ||
package, see :trac:`16774`. | ||
""" | ||
stars = '*' * 72 | ||
|
||
print(stars, file=sys.stderr) | ||
import traceback | ||
traceback.print_exception(*exc, file=sys.stderr) | ||
print(stars, file=sys.stderr) | ||
print("Error building the Sage library", file=sys.stderr) | ||
print(stars, file=sys.stderr) | ||
|
||
try: | ||
logfile = os.environ['SAGE_LOGFILE'] # Set by build/bin/sage-logger | ||
except Exception: | ||
pass | ||
else: | ||
print("Please email sage-devel (http://groups.google.com/group/sage-devel)", file=sys.stderr) | ||
print("explaining the problem and including the relevant part of the log file", file=sys.stderr) | ||
print(" " + logfile, file=sys.stderr) | ||
print("Describe your computer, operating system, etc.", file=sys.stderr) | ||
print(stars, file=sys.stderr) |
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