Skip to content

Commit 2e616cb

Browse files
committed
monkey with env
1 parent 05923f7 commit 2e616cb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/jedi_cache.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
*sys.modules,
2424
]
2525

26+
ENV = jedi.InterpreterEnvironment()
27+
2628

2729
def warm_up_one(module):
2830
print(module, end="\t")
2931
start = time.time()
30-
script = jedi.Script(SOURCE_TEMPLATE.format(module=module))
32+
script = jedi.Script(SOURCE_TEMPLATE.format(module=module), environment=ENV)
3133
completions = len(script.complete(3, len("{}.".format(module))))
3234
end = time.time()
3335
print("\t", completions, end - start)
@@ -53,9 +55,8 @@ def print_env():
5355

5456
def setup_jedi():
5557
print("default jedi environment", jedi.api.environment.get_default_environment())
56-
jedi_cache = pathlib.Path(
57-
jedi.settings.cache_directory, environment=jedi.InterpreterEnvironment()
58-
)
58+
print("jedi environment", ENV)
59+
jedi_cache = pathlib.Path(jedi.settings.cache_directory)
5960
if jedi_cache.exists():
6061
shutil.rmtree(jedi_cache)
6162
print("removed jedi cache!")

0 commit comments

Comments
 (0)