High byte is the exit status.
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index c7a349b..f75858d 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -575,7 +575,7 @@
    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', stdin=PIPE)