]> granicus.if.org Git - python/commitdiff
Try to fix breakage caused by patch #1479181, r45850
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 2 May 2006 06:23:22 +0000 (06:23 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 2 May 2006 06:23:22 +0000 (06:23 +0000)
Lib/subprocess.py
Lib/test/test_subprocess.py

index 4f383147b0384759c61eb04492eb63365a4b04ba..87508ccff2ca29117aa08734b3714ec4712cda62 100644 (file)
@@ -872,7 +872,7 @@ class Popen(object):
             # 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 @@ class Popen(object):
             # 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:
index 88a4baa87decfba2c7b6452b0e422e62ce2dde0f..edf5bd0fd69a20490b0b5f16762b3f15750e0447 100644 (file)
@@ -347,7 +347,7 @@ class ProcessTestCase(unittest.TestCase):
                          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 @@ class ProcessTestCase(unittest.TestCase):
                          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")