]> granicus.if.org Git - python/commitdiff
Remove warnings generated for the suprocess module when run under -3. Required
authorBrett Cannon <bcannon@gmail.com>
Fri, 8 Aug 2008 04:19:32 +0000 (04:19 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 8 Aug 2008 04:19:32 +0000 (04:19 +0000)
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).

Lib/subprocess.py
Misc/NEWS

index f2c91f13e0510be7efd0b5a9234556a6407648ac..935827ace901893e7e793f2401d0255e29f26a44 100644 (file)
@@ -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()
index 2a01e0157f08a5aee555e3bd9ca0b3e62a1ca047..3285b248dcb4414b32af2d8d5ab4ca4601d64dba 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -48,8 +48,9 @@ Library
   while running under the ``-3`` flag: aifc, asyncore, bdb, bsddb,
   ConfigParser, cookielib, DocXMLRPCServer, email, filecmp, fileinput, inspect,
   logging, modulefinder, pdb, pickle, profile, pstats, pydoc, re, rlcompleter,
-  SimpleXMLRPCServer, shelve, sqlite3, tarfile, Tkinter, test.test_support,
-  textwrap, threading, tokenize, traceback, urlparse, wsgiref, xml, xmlrpclib.
+  SimpleXMLRPCServer, shelve, subprocess, sqlite3, tarfile, Tkinter,
+  test.test_support, textwrap, threading, tokenize, traceback, urlparse,
+  wsgiref, xml, xmlrpclib.
 
 - Issue #3039: Fix tarfile.TarFileCompat.writestr() which always
   raised an AttributeError.