We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 294590f commit 2700a7dCopy full SHA for 2700a7d
1 file changed
pre_commit/languages/rust.py
@@ -142,10 +142,15 @@ def install_environment(
142
else:
143
packages_to_install.add((package,))
144
145
- with in_env(prefix, version):
+ with contextlib.ExitStack() as ctx:
146
+ ctx.enter_context(in_env(prefix, version))
147
+
148
if version != 'system':
149
install_rust_with_toolchain(_rust_toolchain(version))
150
151
+ tmpdir = ctx.enter_context(tempfile.TemporaryDirectory())
152
+ ctx.enter_context(envcontext((('RUSTUP_HOME', tmpdir),)))
153
154
if len(lib_deps) > 0:
155
_add_dependencies(prefix, lib_deps)
156
0 commit comments