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

Fix print stderr on failure at check_output tool. #5548

Merged
merged 2 commits into from Jul 29, 2019

Conversation

@lasote
Copy link
Contributor

@lasote lasote commented Jul 29, 2019

Changelog: Bugfix: The stderr was not printed when a command failed running the tools.check_output function.
Docs: omit

@tags: svn

@lasote lasote added this to the 1.18 milestone Jul 29, 2019
@lasote lasote requested a review from jgsogo Jul 29, 2019
@lasote lasote requested a review from SSE4 Jul 29, 2019

if return_code:
return process.returncode

if process.returncode:
raise CalledProcessError(process.returncode, cmd)
# Only in case of error, we print also the stderr to know what happened
raise CalledProcessErrorWithStderr(process.returncode, cmd, stderr=stderr)
Copy link
Member

@memsharded memsharded Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError

Changed in version 3.5: stdout and stderr attributes added

Will crash in other python versions and in 2.7

Copy link
Contributor Author

@lasote lasote Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fixed.

SSE4
SSE4 approved these changes Jul 29, 2019
jgsogo
jgsogo approved these changes Jul 29, 2019
@lasote lasote merged commit f4e77dc into conan-io:develop Jul 29, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants