From 81c69aafecb4d63054b45a3eac86642f9ee6040c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 24 Sep 2009 21:48:07 +0000 Subject: Make _test_pty_eof() return None if openpty() fails. svn path=/main/trunk/; revision=14414 --- pym/portage/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index e04e37a82..159515776 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -3743,6 +3743,8 @@ def _test_pty_eof(): """ Returns True if this issues is fixed for the currently running version of python: http://bugs.python.org/issue5380 + Returns None if openpty fails, and False if the above issue + is not fixed. """ import array, pty, termios @@ -3753,7 +3755,9 @@ def _test_pty_eof(): try: master_fd, slave_fd = pty.openpty() except EnvironmentError: - return False + global _disable_openpty + _disable_openpty = True + return None master_file = os.fdopen(master_fd, 'rb') slave_file = os.fdopen(slave_fd, 'wb') -- cgit v1.2.3-1-g7c22