diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 0dac62e4fc9..9f4b90448d6 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -541,7 +541,7 @@ Return code handling translates as follows:: pipe = os.popen("cmd", 'w') ... rc = pipe.close() - if rc != None and rc % 256: + if rc is not None and rc % 256: print "There were some errors" ==> process = Popen("cmd", 'w', shell=True, stdin=PIPE) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index ba5ce015759..59ed60c16a2 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -349,7 +349,7 @@ class Popen(args, bufsize=0, executable=None, pipe = os.popen("cmd", 'w') ... rc = pipe.close() -if rc != None and rc % 256: +if rc is not None and rc % 256: print "There were some errors" ==> process = Popen("cmd", 'w', shell=True, stdin=PIPE)