From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 551961381F3 for ; Mon, 2 Sep 2013 00:55:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 14B54E0996; Mon, 2 Sep 2013 00:55:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 98F6EE0996 for ; Mon, 2 Sep 2013 00:55:45 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ACF0133DACA for ; Mon, 2 Sep 2013 00:55:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3908EE468F for ; Mon, 2 Sep 2013 00:55:43 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1378083321.617c0ebf31f09e424442e0bc2e7e5b1c6407a056.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/process.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 617c0ebf31f09e424442e0bc2e7e5b1c6407a056 X-VCS-Branch: master Date: Mon, 2 Sep 2013 00:55:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3e0252d9-50a3-4164-883d-f9cf760bdb36 X-Archives-Hash: 0b6dd5c011655186cef546df1c3f7dd1 commit: 617c0ebf31f09e424442e0bc2e7e5b1c6407a056 Author: Zac Medico gentoo org> AuthorDate: Mon Sep 2 00:55:21 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Sep 2 00:55:21 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=617c0ebf _setup_pipes: fix for Python 3.1 to 3.3 This fixes a case where /dev/null stdin fails to inherit since commit bd2128b7a750a68470f857162784e55b8ac39de2. --- pym/portage/process.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pym/portage/process.py b/pym/portage/process.py index 2a2fcac..9ae7a55 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -583,9 +583,14 @@ def _setup_pipes(fd_pipes, close_fds=True, inheritable=None): if oldfd != newfd: os.dup2(oldfd, newfd) - if old_fdflags is None: - old_fdflags = fcntl.fcntl(oldfd, fcntl.F_GETFD) - fcntl.fcntl(newfd, fcntl.F_SETFD, old_fdflags) + if _set_inheritable is not None: + # Don't do this unless _set_inheritable is available, + # since it's used below to ensure correct state, and + # otherwise /dev/null stdin fails to inherit (at least + # with Python versions from 3.1 to 3.3). + if old_fdflags is None: + old_fdflags = fcntl.fcntl(oldfd, fcntl.F_GETFD) + fcntl.fcntl(newfd, fcntl.F_SETFD, old_fdflags) if _set_inheritable is not None: