@@ -35,7 +35,7 @@ def install_environment(
3535 'executables in the application search path' ,
3636 )
3737
38- envdir = prefix . path ( helpers .environment_dir (ENVIRONMENT_DIR , version ) )
38+ envdir = helpers .environment_dir (prefix , ENVIRONMENT_DIR , version )
3939 channel = prefix .path ('.pre-commit-channel' )
4040 for app_descriptor in os .listdir (channel ):
4141 _ , app_file = os .path .split (app_descriptor )
@@ -62,11 +62,10 @@ def get_env_patch(target_dir: str) -> PatchesT: # pragma: win32 no cover
6262@contextlib .contextmanager
6363def in_env (
6464 prefix : Prefix ,
65+ language_version : str ,
6566) -> Generator [None , None , None ]: # pragma: win32 no cover
66- target_dir = prefix .path (
67- helpers .environment_dir (ENVIRONMENT_DIR , get_default_version ()),
68- )
69- with envcontext (get_env_patch (target_dir )):
67+ envdir = helpers .environment_dir (prefix , ENVIRONMENT_DIR , language_version )
68+ with envcontext (get_env_patch (envdir )):
7069 yield
7170
7271
@@ -75,5 +74,5 @@ def run_hook(
7574 file_args : Sequence [str ],
7675 color : bool ,
7776) -> tuple [int , bytes ]: # pragma: win32 no cover
78- with in_env (hook .prefix ):
77+ with in_env (hook .prefix , hook . language_version ):
7978 return helpers .run_xargs (hook , hook .cmd , file_args , color = color )
0 commit comments