Fixup #17 which replaced commands.getstatusoutput() without taking the changed return code into account
#22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the 1st commit of #17 which replaced
commands.getstatusoutput()withsubprocess.getstatusoutput()without taking the change of thestatuscode into account:Unfortunately, the Python3 developers broke the compatibility: The return code changes!!!
With commands.getstatusoutput(), you had to use this to get the actual exit code:
These calls have to be removed because now they just shift away the error code:
As shown at benjaminp/six#207, the operation is just
status >> 8Luckily, the status code is checked to against 0 at most places, so there is no change
for these checks. There is only one location where a bit is checked. Fix this location too.
Also, that commit did not take into account that
subprocess.get*outputdo not existin
Python2, which goes against the directive by Andrew in PR #16 where he requiresthat we keep Python2 working:
The current master branch works neither for Python2 nor Python3.
Fix this breakage in the 2nd commit:
Fix the code base to work at least with one Python version(Python2)
After the previous commit updated the code base to work with the exit status
returned by Python3
getstatusoutput(), add a compatible wrapper forcommands.getstatusoutput()to have one Python version functional.