Python Error Codes are upshifted
<p>Consider a python script error.py</p>

<pre><code>import sys
sys.exit(3)
</code></pre>

<p>Invoking</p>

<pre><code>python error.py; echo $?
</code></pre>

<p>yields the expected "3". However, consider runner.py</p>

<pre><code>import os
result = os.system("python error.py")
print result
</code></pre>

<p>yields 768. It seems that somehow the result of python code has been leftshifted by 8, but how these two situations are different is not clear. What's going on?</p>

<p>This is occurring in python 2.5 and 2.6.</p>
