summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2012-02-21 21:10:16 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2012-02-21 21:10:16 (GMT)
commit65532111b41b7ad57f377997bf2c653495b2207a (patch)
treec8daae22222f9ee4b157119ed31a1ab9e577acf7 /Lib
parentc9f54cf512996790266c17f81584c9725ee99d47 (diff)
downloadcpython-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.py2
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)