From: Zac Medico Date: Thu, 24 Sep 2009 21:48:07 +0000 (-0000) Subject: Make _test_pty_eof() return None if openpty() fails. X-Git-Tag: v2.2_rc42~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=81c69aafecb4d63054b45a3eac86642f9ee6040c;p=portage.git Make _test_pty_eof() return None if openpty() fails. svn path=/main/trunk/; revision=14414 --- 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')