##// 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 for m in 'ctypes', 'email':
48 for m in 'ctypes', 'email':
49 yield m
49 yield m
50 yield 'builtins' # python3 only
50 yield 'builtins' # python3 only
51 stdlib_prefixes = set([sys.prefix, sys.exec_prefix])
51 for libpath in sys.path:
52 for libpath in sys.path:
52 # We want to walk everything in sys.path that starts with
53 # We want to walk everything in sys.path that starts with something
53 # either sys.prefix or sys.exec_prefix.
54 # in stdlib_prefixes.
54 if not (libpath.startswith(sys.prefix)
55 for prefix in stdlib_prefixes:
55 or libpath.startswith(sys.exec_prefix)):
56 if libpath.startswith(prefix):
57 break
58 else:
56 continue
59 continue
57 if 'site-packages' in libpath:
60 if 'site-packages' in libpath:
58 continue
61 continue
General Comments 0
You need to be logged in to leave comments. Login now