From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BBD52138334 for ; Mon, 28 Jan 2019 19:45:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E22D2E08F6; Mon, 28 Jan 2019 19:45:58 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BCABBE08F6 for ; Mon, 28 Jan 2019 19:45:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7C0DA335D01 for ; Mon, 28 Jan 2019 19:45:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2CF6152A for ; Mon, 28 Jan 2019 19:45:56 +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: <1548704541.d66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/pid-ns-init X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: d66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586 X-VCS-Branch: master Date: Mon, 28 Jan 2019 19:45:56 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 02f1edc7-126d-4f38-83b4-ce7eea101943 X-Archives-Hash: bc1a42abc08eaa6a1042c406b1c53f5a commit: d66f4238e6b5dca2bbc0fb04f64c67f3e0bc3586 Author: Zac Medico gentoo org> AuthorDate: Mon Jan 28 19:27:47 2019 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Jan 28 19:42:21 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d66f4238 pid-sandbox: handle EnvironmentError for python2 compat (bug 675868) The fcntl.ioctl call raises IOError, which is different from OSError for python2. Use EnvironmentError for compatibility. Bug: https://bugs.gentoo.org/675868 Reported-by: Ivan Ivanich ivanich.org.ua> Fixes: ce0656337268 ("pid-sandbox: pid-ns-init TIOCSCTTY after setsid (bug 675868)") Signed-off-by: Zac Medico gentoo.org> bin/pid-ns-init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pid-ns-init b/bin/pid-ns-init index d8e67cf6d..cfbd65280 100644 --- a/bin/pid-ns-init +++ b/bin/pid-ns-init @@ -80,7 +80,7 @@ def main(argv): if sys.stdout.isatty(): try: fcntl.ioctl(sys.stdout, termios.TIOCSCTTY, 0) - except OSError as e: + except EnvironmentError as e: if e.errno == errno.EPERM: # This means that stdout refers to the controlling terminal # of the parent process, and in this case we do not want to @@ -101,7 +101,7 @@ def main(argv): while True: try: pid, status = os.wait() - except OSError as e: + except EnvironmentError as e: if e.errno == errno.EINTR: continue raise