Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tarasfrompir
Copy link

No description provided.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@erogol
Copy link
Member

erogol commented Aug 26, 2022

Hey thanks for the PR but why do we assume python for win32?

@tarasfrompir
Copy link
Author

Because it is written in the sys module documentation -
Windows | 'win32'

https://docs.python.org/3/library/sys.html

@erogol
Copy link
Member

erogol commented Oct 19, 2023

@tarasfrompir do you mind signing the CLA for me to merge the PR

Comment on lines +55 to +58
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
Copy link

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.

Suggested change
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

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants