Skip to content

Commit

Permalink
fix: Windows execvpe doesn't work as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
renan-r-santos committed Apr 17, 2024
1 parent da062f7 commit 9c0d30b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pixi_kernel/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
import os
import platform
import subprocess
import sys
import typing
from pathlib import Path
Expand Down Expand Up @@ -60,7 +62,13 @@ def main() -> None:
env["R_LIBS_USER"] = r_libs_path

logger.info(f"launching {kernel_display_name} kernel with {args}")
os.execvpe("pixi", args, env)

if platform.system() == "Windows":
executable = subprocess.Popen(args, env=env)
return_code = executable.wait()
sys.exit(return_code)
else:
os.execvpe("pixi", args, env)


if __name__ == "__main__":
Expand Down

0 comments on commit 9c0d30b

Please sign in to comment.