]> granicus.if.org Git - python/commitdiff
High byte is the exit status.
authorStefan Krah <stefan@bytereef.org>
Wed, 14 Jul 2010 10:06:07 +0000 (10:06 +0000)
committerStefan Krah <stefan@bytereef.org>
Wed, 14 Jul 2010 10:06:07 +0000 (10:06 +0000)
Doc/library/subprocess.rst

index b5e769cab596024897a3841e034594168f4d1abf..3ca0db98cbad185f8fdcca304cef9388d8ffe108 100644 (file)
@@ -551,7 +551,7 @@ Return code handling translates as follows::
    pipe = os.popen("cmd", 'w')
    ...
    rc = pipe.close()
-   if rc is not None and rc % 256:
+   if rc is not None and rc >> 8:
        print "There were some errors"
    ==>
    process = Popen("cmd", 'w', shell=True, stdin=PIPE)