commands.getstatusoutput result is not command line exit value!!!
Donn Cave
donn at u.washington.edu
Mon Oct 2 14:04:30 EDT 2006
In article <mailman.1103.1159803852.10491.python-list at python.org>,
Steve Holden <steve at holdenweb.com> wrote:
> Basically the value you want is shifted up 8 bits. Perhaps I should more
> understandably have said:
>
> 12 << 8 == 3072
Or as already suggested in other followups, use os.WEXITSTATUS
(and os.WIFEXITED.) Not only does this do more precisely the
right thing, it will work on any platform that supports a
POSIX wait -- which doesn't require that exit == status << 8,
only that WEXITSTATUS be able to return that value.
Donn Cave, donn at u.washington.edu
More information about the Python-list
mailing list