Commit e2edd13
committed
Fix the 1st commit of #17: incompatible retcode of subprocess.getstatusoutput()
Fix the 1st commit of #17 which replaced commands.getstatusoutput() with
subprocess.getstatusoutput() without taking the change of the status code into account:
Unfortunately, the Python3 developers broke the compatibility: The return code changes:
python2 -c 'import commands ; print( commands.getstatusoutput("false"))'
(256, '')
python3 -c 'import subprocess; print(subprocess.getstatusoutput("false"))'
(1, '')
With commands.getstatusoutput(), you had to use this to get the actual exit code:
status = os.WEXITSTATUS(status)
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 >> 8`
Luckily, 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*output do not exist
in Python2, which goes against the directive by Andrew in PR #16 where he requires
that we keep Python2 working:
The current master branch works neither for Python2, nor Python3 - fix this breakage
in the 2nd commit.
Signed-off-by: Bernhard Kaindl <[email protected]>1 parent d3f38b6 commit e2edd13
File tree
3 files changed
+1
-3
lines changed- plugins-base
3 files changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
| 385 | + | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
0 commit comments