print ("WARNING: The analysis will extract the standard library. This behavior is deprecated and will be removed in a future release. We expect it to be gone in CLI version 2.20.0.")
else:
print ("INFO: The Python extractor has recently stopped extracting the standard library by default. If you encounter problems, please let us know by submitting an issue to https://github.com/github/codeql. It is possible to re-enable extraction of the standard library by setting the environment variable CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB.")
returnoptions, args
defsplit_and_flatten(options_list, div):
result= []
foriteminoptions_list:
result.extend(item.split(div))
returnresult
defis_legal_module_name(name):
foridentifierinname.split("."):
ifnotidentifier.isidentifier():
returnFalse
returnTrue
defverify_module_name(name):
ifnotis_legal_module_name(name):
sys.exit("'%s' is not a legal module name"%name)
EXTRA_HELP='''
When combining explicitly listed modules, or any options to include modules, with any option to exclude modules, the exclude options act as filters on the included modules.
Therefore if any module is both excluded and included by a command line option, then it will not be included in the database.
Note that exclusion of a module does not necessarily exclude the modules that are imported by that module.
For example, if module 'a' imports module 'b' and module 'c' also imports module 'b' and the extractor is called with "-y c a",
then 'c' will be excluded but 'b' will be included as it is imported by 'a'.