Skip to content

Commit 3a53787

Browse files
committed
python: do not extract stdlib by default
1 parent 3434c38 commit 3a53787

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/extractor/cli-integration-test/extract-stdlib/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ rm -rf dbs
1313

1414
mkdir dbs
1515

16-
CODEQL_EXTRACTOR_PYTHON_DONT_EXTRACT_STDLIB=True $CODEQL database create dbs/without-stdlib --language python --source-root repo_dir/
16+
$CODEQL database create dbs/without-stdlib --language python --source-root repo_dir/
1717
$CODEQL query run --database dbs/without-stdlib query.ql > query.without-stdlib.actual
1818
diff query.without-stdlib.expected query.without-stdlib.actual
1919

20-
LGTM_INDEX_EXCLUDE="/usr/lib/**" $CODEQL database create dbs/with-stdlib --language python --source-root repo_dir/
20+
LGTM_INDEX_EXCLUDE="/usr/lib/**" CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB=True $CODEQL database create dbs/with-stdlib --language python --source-root repo_dir/
2121
$CODEQL query run --database dbs/with-stdlib query.ql > query.with-stdlib.actual
2222
diff query.with-stdlib.expected query.with-stdlib.actual

python/extractor/semmle/cmdline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def make_parser():
102102
config_options.add_option("--colorize", dest="colorize", default=False, action="store_true",
103103
help = """Colorize the logging output.""")
104104

105-
config_options.add_option("--dont-extract-stdlib", dest="extract_stdlib", default=True, action="store_false",
106-
help="Do not extract the standard library.")
105+
config_options.add_option("--extract-stdlib", dest="extract_stdlib", default=False, action="store_true",
106+
help="Extract the standard library.")
107107

108108
parser.add_option_group(config_options)
109109

@@ -224,8 +224,8 @@ def parse(command_line):
224224
max_import_depth = float('inf')
225225
options.max_import_depth = max_import_depth
226226

227-
if 'CODEQL_EXTRACTOR_PYTHON_DONT_EXTRACT_STDLIB' in os.environ:
228-
options.extract_stdlib = False
227+
if 'CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB' in os.environ:
228+
options.extract_stdlib = True
229229

230230
options.prune = True
231231
return options, args

0 commit comments

Comments
 (0)