-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change path to python for Windows os #63
base: main
Are you sure you want to change the base?
Conversation
|
Hey thanks for the PR but why do we assume |
Because it is written in the sys module documentation - |
@tarasfrompir do you mind signing the CLA for me to merge the PR |
if sys.platform == 'win32': | ||
p = subprocess.Popen(["python"] + command, stdout=stdout, env=my_env) # pylint: disable=consider-using-with | ||
else: | ||
p = subprocess.Popen(["python3"] + command, stdout=stdout, env=my_env) # pylint: disable=consider-using-with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct, platform-and-virtualenv-agnostic way to do this is sys.executable
.
if sys.platform == 'win32': | |
p = subprocess.Popen(["python"] + command, stdout=stdout, env=my_env) # pylint: disable=consider-using-with | |
else: | |
p = subprocess.Popen(["python3"] + command, stdout=stdout, env=my_env) # pylint: disable=consider-using-with | |
p = subprocess.Popen([sys.executable, *command], stdout=stdout, env=my_env) # pylint: disable=consider-using-with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we don't need to run this if it is not Win32.
No description provided.