File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1687,7 +1687,13 @@ def get_importable_stdlib_modules() -> set[str]:
16871687 for finder , module_group in modules_by_finder .items ():
16881688 if (
16891689 "site-packages" not in Path (finder .path ).parents
1690- and {"json" , "_json" , "_queue" } & module_group
1690+ # if "_queue" is present, it's most likely the module finder
1691+ # for stdlib extension modules;
1692+ # if "queue" is present, it's most likely the module finder
1693+ # for pure-Python stdlib modules.
1694+ # In either case, we'll want to add all the modules that the finder has to offer us.
1695+ # This is a bit hacky, but seems to work well in a cross-platform way.
1696+ and {"_queue" , "queue" } & module_group
16911697 ):
16921698 all_stdlib_modules .update (module_group )
16931699
@@ -1736,6 +1742,8 @@ def get_importable_stdlib_modules() -> set[str]:
17361742 except KeyboardInterrupt :
17371743 raise
17381744 # importing multiprocessing.popen_forkserver on Windows raises AttributeError...
1745+ # some submodules also appear to raise SystemExit as well on some Python versions
1746+ # (not sure exactly which)
17391747 except BaseException :
17401748 continue
17411749 else :
You can’t perform that action at this time.
0 commit comments