Skip to content

Commit

Permalink
wsl: add missing path for python
Browse files Browse the repository at this point in the history
  • Loading branch information
NIC-MichalLabedzki committed Apr 25, 2020
1 parent cb8e18e commit 3a07e4c
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ def wsl_to_windows_path(wsl_path):
module_wsl_path = os.path.join('.nfdir', 'wsl', 'win10toast-persist')
module_win_path = wsl_to_windows_path(module_wsl_path)
nf_win_file = wsl_to_windows_path('nf.py')
cmdline_args = ['python.exe', '-c', "import sys;sys.path.insert(0,{});f = open({}, encoding='utf-8');s = f.read();print(exec(s));".format(repr(module_win_path), repr(nf_win_file))] + argv
cmdline_args = ['python.exe', '-c', "import sys;sys.path.insert(0,{});sys.path.insert(0,'');f = open({}, encoding='utf-8');s = f.read();print(exec(s));".format(repr(module_win_path), repr(nf_win_file))] + argv
log('run external python:', cmdline_args)
if sys.version_info >= (3, 5):
nf_exit_code = subprocess.run(cmdline_args, shell=False).returncode
Expand All @@ -782,17 +782,6 @@ def wsl_to_windows_path(wsl_path):
log('run external python failed for: <{}> exit code {}'.format(cmdline_args, nf_exit_code), e)
print_stdout('ERROR: Cannot run external python, last3 win step')

try:
cmdline_args = ['python.exe', '-m', 'pip']
if sys.version_info >= (3, 5):
import subprocess
cmd_exit_code = subprocess.run(cmdline_args, shell=False).returncode
else:
import subprocess
cmd_exit_code = subprocess.call(cmdline_args, shell=False)
except Exception as e:
log('python win pip check'.format(cmdline_args, cmd_exit_code), e)

#nf_exit_code = 0
#try:
# cmdline_args = ['python.exe', __file__] + argv
Expand Down

0 comments on commit 3a07e4c

Please sign in to comment.