This supersedes Popen and corrects a bug in cPython implementation
| 1153 | |
| 1154 | |
| 1155 | class Popen(subprocess.Popen): |
| 1156 | """ |
| 1157 | This supersedes Popen and corrects a bug in cPython implementation |
| 1158 | """ |
| 1159 | def _execute_child(self, args, executable, preexec_fn, close_fds, |
| 1160 | cwd, env, universal_newlines, |
| 1161 | startupinfo, creationflags, shell, to_close, |
| 1162 | p2cread, p2cwrite, |
| 1163 | c2pread, c2pwrite, |
| 1164 | errread, errwrite): |
| 1165 | |
| 1166 | if not isinstance(args, subprocess.types.StringTypes): |
| 1167 | args = subprocess.list2cmdline(args) |
| 1168 | |
| 1169 | if startupinfo is None: |
| 1170 | startupinfo = subprocess.STARTUPINFO() |
| 1171 | if shell: |
| 1172 | startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW |
| 1173 | startupinfo.wShowWindow = _subprocess.SW_HIDE |
| 1174 | comspec = os.environ.get("COMSPEC", u"cmd.exe") |
| 1175 | args = u'%s /c "%s"' % (comspec, args) |
| 1176 | if _subprocess.GetVersion() >= 0x80000000 or os.path.basename(comspec).lower() == "command.com": |
| 1177 | w9xpopen = self._find_w9xpopen() |
| 1178 | args = u'"%s" %s' % (w9xpopen, args) |
| 1179 | creationflags |= _subprocess.CREATE_NEW_CONSOLE |
| 1180 | |
| 1181 | super(Popen, self)._execute_child(args, executable, preexec_fn, close_fds, |
| 1182 | cwd, env, universal_newlines, |
| 1183 | startupinfo, creationflags, False, to_close, |
| 1184 | p2cread, p2cwrite, |
| 1185 | c2pread, c2pwrite, |
| 1186 | errread, errwrite) |
| 1187 | |
| 1188 | _subprocess.CreateProcess = CreateProcess |
no outgoing calls
no test coverage detected