diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2012-02-21 21:10:16 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2012-02-21 21:10:16 (GMT) |
commit | 65532111b41b7ad57f377997bf2c653495b2207a (patch) | |
tree | c8daae22222f9ee4b157119ed31a1ab9e577acf7 /Lib | |
parent | c9f54cf512996790266c17f81584c9725ee99d47 (diff) | |
download | cpython-65532111b41b7ad57f377997bf2c653495b2207a.zip cpython-65532111b41b7ad57f377997bf2c653495b2207a.tar.gz cpython-65532111b41b7ad57f377997bf2c653495b2207a.tar.bz2 |
site: don't import traceback at startup to speed up Python startup
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/site.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/site.py b/Lib/site.py index 6ef1e0b..b83498e 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -55,7 +55,6 @@ ImportError exception, it is silently ignored. import sys import os import builtins -import traceback # Prefixes for site-packages; add additional prefixes like /usr/local here PREFIXES = [sys.prefix, sys.exec_prefix] @@ -157,6 +156,7 @@ def addpackage(sitedir, name, known_paths): except Exception: print("Error processing line {:d} of {}:\n".format(n+1, fullname), file=sys.stderr) + import traceback for record in traceback.format_exception(*sys.exc_info()): for line in record.splitlines(): print(' '+line, file=sys.stderr) |