summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-08-08 04:19:32 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-08-08 04:19:32 (GMT)
commit03446c43ca3a4be2097782f590b71a596a0158cc (patch)
tree57b2954f2369778a55b05142fac038b8893e6018 /Lib/subprocess.py
parent0563a8ffd14c685fe1bf155e120b67a5e9311570 (diff)
downloadcpython-03446c43ca3a4be2097782f590b71a596a0158cc.zip
cpython-03446c43ca3a4be2097782f590b71a596a0158cc.tar.gz
cpython-03446c43ca3a4be2097782f590b71a596a0158cc.tar.bz2
Remove warnings generated for the suprocess module when run under -3. Required
commenting out True/False compatbility stuff, remove a use of apply(), and remove a use of buffer() (just pulled the solution used in 3.0 which is direct slicing).
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index f2c91f1..935827a 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -411,11 +411,11 @@ except:
MAXFD = 256
# True/False does not exist on 2.2.0
-try:
- False
-except NameError:
- False = 0
- True = 1
+#try:
+# False
+#except NameError:
+# False = 0
+# True = 1
_active = []
@@ -1066,7 +1066,7 @@ class Popen(object):
os.chdir(cwd)
if preexec_fn:
- apply(preexec_fn)
+ preexec_fn()
if env is None:
os.execvp(executable, args)
@@ -1173,7 +1173,8 @@ class Popen(object):
# When select has indicated that the file is writable,
# we can write up to PIPE_BUF bytes without risk
# blocking. POSIX defines PIPE_BUF >= 512
- bytes_written = os.write(self.stdin.fileno(), buffer(input, input_offset, 512))
+ chunk = input[input_offset : input_offset + 512]
+ bytes_written = os.write(self.stdin.fileno(), chunk)
input_offset += bytes_written
if input_offset >= len(input):
self.stdin.close()