Skip to content

Commit 8cfea6c

Browse files
committed
Fix: [ALAS] Use current python executable if the deploy.yaml one does not exist
1 parent cfe187e commit 8cfea6c

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

deploy/Windows/config.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import copy
22
import os
33
import subprocess
4+
import sys
45
from typing import Optional, Union
56

67
from deploy.Windows.logger import logger
@@ -149,7 +150,7 @@ def adb(self) -> str:
149150
if os.path.exists(exe):
150151
return exe
151152

152-
logger.warning(f'AdbExecutable: {exe} does not exists, use `adb` instead')
153+
logger.warning(f'AdbExecutable: {exe} does not exist, use `adb` instead')
153154
return 'adb'
154155

155156
@cached_property
@@ -158,12 +159,18 @@ def git(self) -> str:
158159
if os.path.exists(exe):
159160
return exe
160161

161-
logger.warning(f'GitExecutable: {exe} does not exists, use `git` instead')
162+
logger.warning(f'GitExecutable: {exe} does not exist, use `git` instead')
162163
return 'git'
163164

164165
@cached_property
165166
def python(self) -> str:
166-
return self.filepath(self.PythonExecutable)
167+
exe = self.filepath(self.PythonExecutable)
168+
if os.path.exists(exe):
169+
return exe
170+
171+
current = sys.executable.replace("\\", "/")
172+
logger.warning(f'PythonExecutable: {exe} does not exist, use current python instead: {current}')
173+
return current
167174

168175
@cached_property
169176
def requirements_file(self) -> str:

0 commit comments

Comments
 (0)