We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ac585d commit df491f9Copy full SHA for df491f9
1 file changed
src/cs50/cs50.py
@@ -6,7 +6,6 @@
6
7
from distutils.sysconfig import get_python_lib
8
from os.path import abspath, join
9
-from site import getusersitepackages
10
from termcolor import cprint
11
from traceback import extract_tb, format_list, format_exception_only
12
@@ -16,10 +15,9 @@ def excepthook(type, value, tb):
16
15
Format traceback, darkening entries from global site-packages directories
17
and user-specific site-packages directory.
18
19
- https://stackoverflow.com/a/33042323/5156190
20
- https://stackoverflow.com/a/122340/5156190
+ https://stackoverflow.com/a/46071447/5156190
21
"""
22
- packages = tuple(join(abspath(p), "") for p in [get_python_lib(), getusersitepackages()])
+ packages = tuple(join(abspath(p), "") for p in sys.path[1:])
23
for entry in extract_tb(tb):
24
fmt = format_list((entry,))
25
if (entry[0].startswith(packages)):
0 commit comments