Skip to content

Commit de48f84

Browse files
committed
Adjust exec discoverability on Windows
1 parent 29f4f87 commit de48f84

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import platform
33
import subprocess
4+
import sys
45
from contextlib import contextmanager
56
from typing import Dict, Optional, Union, List
67

@@ -42,6 +43,11 @@ def run_command(
4243
if env is None:
4344
env = os.environ.copy()
4445

46+
# Special handling for 'dotenv' commands - use Python module directly
47+
if isinstance(cmd, list) and cmd and cmd[0] == "dotenv":
48+
# Replace 'dotenv' with 'python -m dotenv'
49+
cmd = [sys.executable, "-m", "dotenv"] + cmd[1:]
50+
4551
# Convert string command to list for subprocess if needed
4652
if isinstance(cmd, str):
4753
if IS_WINDOWS:

0 commit comments

Comments
 (0)