Commit 95b057e3 authored by Martin v. Löwis's avatar Martin v. Löwis

Patch #487784: Support Unicode commands in popen3/4 handling on UNIX.

parent 06f15bbc
...@@ -8,6 +8,7 @@ and popen3(cmd) which return two or three pipes to the spawned command. ...@@ -8,6 +8,7 @@ and popen3(cmd) which return two or three pipes to the spawned command.
import os import os
import sys import sys
import types
__all__ = ["popen2", "popen3", "popen4"] __all__ = ["popen2", "popen3", "popen4"]
...@@ -56,7 +57,7 @@ class Popen3: ...@@ -56,7 +57,7 @@ class Popen3:
_active.append(self) _active.append(self)
def _run_child(self, cmd): def _run_child(self, cmd):
if type(cmd) == type(''): if isinstance(cmd, types.StringTypes):
cmd = ['/bin/sh', '-c', cmd] cmd = ['/bin/sh', '-c', cmd]
for i in range(3, MAXFD): for i in range(3, MAXFD):
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment