[Python-checkins] r45852 - in python/trunk/Lib: subprocess.py test/test_subprocess.py

neal.norwitz python-checkins at python.org
Tue May 2 08:23:23 CEST 2006


Author: neal.norwitz
Date: Tue May  2 08:23:22 2006
New Revision: 45852

Modified:
   python/trunk/Lib/subprocess.py
   python/trunk/Lib/test/test_subprocess.py
Log:
Try to fix breakage caused by patch #1479181, r45850

Modified: python/trunk/Lib/subprocess.py
==============================================================================
--- python/trunk/Lib/subprocess.py	(original)
+++ python/trunk/Lib/subprocess.py	Tue May  2 08:23:22 2006
@@ -872,7 +872,7 @@
             # object do the translation: It is based on stdio, which is
             # impossible to combine with select (unless forcing no
             # buffering).
-            if self.universal_newlines and hasattr(open, 'newlines'):
+            if self.universal_newlines and hasattr(file, 'newlines'):
                 if stdout:
                     stdout = self._translate_newlines(stdout)
                 if stderr:
@@ -1141,7 +1141,7 @@
             # object do the translation: It is based on stdio, which is
             # impossible to combine with select (unless forcing no
             # buffering).
-            if self.universal_newlines and hasattr(open, 'newlines'):
+            if self.universal_newlines and hasattr(file, 'newlines'):
                 if stdout:
                     stdout = self._translate_newlines(stdout)
                 if stderr:

Modified: python/trunk/Lib/test/test_subprocess.py
==============================================================================
--- python/trunk/Lib/test/test_subprocess.py	(original)
+++ python/trunk/Lib/test/test_subprocess.py	Tue May  2 08:23:22 2006
@@ -347,7 +347,7 @@
                          stdout=subprocess.PIPE,
                          universal_newlines=1)
         stdout = p.stdout.read()
-        if hasattr(p.stdout, 'newlines'):
+        if hasattr(file, 'newlines'):
             # Interpreter with universal newline support
             self.assertEqual(stdout,
                              "line1\nline2\nline3\nline4\nline5\nline6")
@@ -374,7 +374,7 @@
                          stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                          universal_newlines=1)
         (stdout, stderr) = p.communicate()
-        if hasattr(stdout, 'newlines'):
+        if hasattr(file, 'newlines'):
             # Interpreter with universal newline support
             self.assertEqual(stdout,
                              "line1\nline2\nline3\nline4\nline5\nline6")


More information about the Python-checkins mailing list