Change all instances of os.system() that do not need to go through the shell to use subprocess.check_call() instead. Not only does this save a process creation, it is also safer, with less chance of being tripped up by filenames with odd characters in them.
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
Comment Actions
Yes, I could do subprocess.run(check = True) instead of subprocess.check_call(); does it really matter either way?
Comment Actions
Applied all except for build_files/buildbot,
- rB7980265e7e509f5d9c9ed0f281c67d0662d4f464
- rB0f14c72c29c9478056f92f102ca9f94ad9f60a5c
- rB9b96dd0f6157fabf0f267ece54fa604094ba303c
- rB19b1b45d715e9c9bb20df77b02dd2943f28cd157
Note that in some cases I had to replace check_call with call, pep8.py exists on the first file which has any warnings for example.
buildbot changes seem OK, but they should be checked first.
Comment Actions
@Lawrence D'Oliveiro (ldo), could you update the patch? some of these have been applied.
For the parts of the code that weren't - these were ares I couldn't test easily.
Comment Actions
Checked this patch and the build-bot changes no longer apply, there are issues in the pep8.py too.
Closing.
| tests/python/pep8.py | ||
|---|---|---|
| 124 | This fails with an error early if there are any warnings: -----------------------------------
Your code has been rated at 9.04/10
Traceback (most recent call last):
File "/src/blender/./tests/python/pep8.py", line 208, in <module>
main()
File "/src/blender/./tests/python/pep8.py", line 202, in main
check_files_pylint(files)
File "/src/blender/./tests/python/pep8.py", line 124, in check_files_pylint
subprocess.check_call((
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('pylint', '--disable=C0111,C0103,C0413,W0613,W0232,W0142,R0902,R0903,R0911,R0912,R0913,R0914,R0915,', '--output-format=parseable', '--reports=n', '--max-line-length=1000', '/src/blender/tests/check_deprecated.py')' returned non-zero exit status 28. | |