Replaced os.popen4 with subprocess.Popen.