##// END OF EJS Templates
import-checker: refactor sys.path prefix check (issue4129)...
Chris Jerdonek -
r20197:761f2929 default
parent child Browse files
Show More
@@ -48,11 +48,14 b' def list_stdlib_modules():'
48 48 for m in 'ctypes', 'email':
49 49 yield m
50 50 yield 'builtins' # python3 only
51 stdlib_prefixes = set([sys.prefix, sys.exec_prefix])
51 52 for libpath in sys.path:
52 # We want to walk everything in sys.path that starts with
53 # either sys.prefix or sys.exec_prefix.
54 if not (libpath.startswith(sys.prefix)
55 or libpath.startswith(sys.exec_prefix)):
53 # We want to walk everything in sys.path that starts with something
54 # in stdlib_prefixes.
55 for prefix in stdlib_prefixes:
56 if libpath.startswith(prefix):
57 break
58 else:
56 59 continue
57 60 if 'site-packages' in libpath:
58 61 continue
General Comments 0
You need to be logged in to leave comments. Login now