-
Notifications
You must be signed in to change notification settings - Fork 1
Use PIPE instead of capture_output to support python3.6 #36
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
Conversation
|
python 3.6 is no longer maintained and is deemed deprecated. |
clang_tools/install.py
Outdated
| try: | ||
| result = subprocess.run( | ||
| [exe_name, "--version"], capture_output=True, check=True | ||
| [exe_name, "--version"], stdout=subprocess.PIPE, check=True |
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.
This isn't totally equivalent, but I think it will work in this case.
According to the docs:
If capture_output is true,
stdoutandstderrwill be captured. When used, the internal Popen object is automatically created withstdout=PIPEandstderr=PIPE. Thestdoutandstderrarguments may not be supplied at the same time as capture_output. If you wish to capture and combine both streams into one, usestdout=PIPEandstderr=STDOUTinstead of capture_output.
Meaning, if you want to apply this change to cpp-linter pkg's use of subprocess.run(), then you'de have to use
result = subprocess.run(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)because we actually use the stderr output in the cpp-linter pkg.
You're right. https://endoflife.date/python. OK, we do not need to test on python3.6. |
2bndy5
left a comment
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'm ok with using this patch. Not all users are keen to keeping their python version in the CI up-to-date.
011416f to
2065aaf
Compare
Codecov Report
@@ Coverage Diff @@
## main #36 +/- ##
=======================================
Coverage 87.71% 87.71%
=======================================
Files 4 4
Lines 171 171
=======================================
Hits 150 150
Misses 21 21
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
Updated. sure, it would be nice if users of the old python version also could use it 😃 |
Python 3.6 does not has
capture_outputhttps://docs.python.org/3.6/library/subprocess.html, usesubprocess.PIPEinstead can fix this problem.I have donwload new build wheel and install on my python3.6 env, it works now.
It would be best to include test on python3.6 with GitHub action if we support py36 in later release.
Fix #34