summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-01-20 18:14:26 -0800
committerZac Medico <zmedico@gentoo.org>2011-01-20 18:14:26 -0800
commit1c0996eea7a39ef0357b5ece630c1bdf69680f71 (patch)
tree2e521d484509d9da3774ad663939e8b3276f6f54 /pym/portage
parentfc9fdba08b5ac46ffb8cdf34753624d6050d8052 (diff)
downloadportage-1c0996eea7a39ef0357b5ece630c1bdf69680f71.tar.gz
portage-1c0996eea7a39ef0357b5ece630c1bdf69680f71.tar.bz2
portage-1c0996eea7a39ef0357b5ece630c1bdf69680f71.zip
SpawnProcess: read proc with unbuffered fdopen
This enables pty support in python3, by using unbuffered fdopen to avoid http://bugs.python.org/issue5380.
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/tests/ebuild/test_pty_eof.py4
-rw-r--r--pym/portage/util/_pty.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/pym/portage/tests/ebuild/test_pty_eof.py b/pym/portage/tests/ebuild/test_pty_eof.py
index c4386e944..251b63c43 100644
--- a/pym/portage/tests/ebuild/test_pty_eof.py
+++ b/pym/portage/tests/ebuild/test_pty_eof.py
@@ -14,7 +14,7 @@ class PtyEofTestCase(TestCase):
# The result is only valid if openpty does not raise EnvironmentError.
if _can_test_pty_eof():
try:
- self.assertEqual(_test_pty_eof(), True)
+ self.assertEqual(_test_pty_eof(fdopen_buffered=True), True)
except EnvironmentError:
pass
@@ -26,6 +26,6 @@ class PtyEofTestCase(TestCase):
# The result is only valid if openpty does not raise EnvironmentError.
if _can_test_pty_eof():
try:
- self.assertEqual(_test_pty_eof(fdopen_buffered=False), True)
+ self.assertEqual(_test_pty_eof(), True)
except EnvironmentError:
pass
diff --git a/pym/portage/util/_pty.py b/pym/portage/util/_pty.py
index 7e769d204..c96bf74fd 100644
--- a/pym/portage/util/_pty.py
+++ b/pym/portage/util/_pty.py
@@ -1,4 +1,4 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import array
@@ -28,7 +28,7 @@ def _can_test_pty_eof():
"""
return platform.system() in ("Linux",)
-def _test_pty_eof(fdopen_buffered=True):
+def _test_pty_eof(fdopen_buffered=False):
"""
Returns True if this issues is fixed for the currently
running version of python: http://bugs.python.org/issue5380