From: Martin v. Löwis Date: Sun, 2 Dec 2001 13:32:15 +0000 (+0000) Subject: Patch #487784: Support Unicode commands in popen3/4 handling on UNIX. X-Git-Tag: v2.2.1c1~617 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95b057e3ea98f78cad8cbee3c77640c11573b792;p=python Patch #487784: Support Unicode commands in popen3/4 handling on UNIX. --- diff --git a/Lib/popen2.py b/Lib/popen2.py index 8b1af7620a..14fe12fe3b 100644 --- a/Lib/popen2.py +++ b/Lib/popen2.py @@ -8,6 +8,7 @@ and popen3(cmd) which return two or three pipes to the spawned command. import os import sys +import types __all__ = ["popen2", "popen3", "popen4"] @@ -56,7 +57,7 @@ class Popen3: _active.append(self) def _run_child(self, cmd): - if type(cmd) == type(''): + if isinstance(cmd, types.StringTypes): cmd = ['/bin/sh', '-c', cmd] for i in range(3, MAXFD): try: